1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v: support dump(expr) (#9160)

This commit is contained in:
Delyan Angelov
2021-03-06 19:09:28 +02:00
committed by GitHub
parent 747507dd1d
commit 849cde245c
18 changed files with 219 additions and 53 deletions

10
examples/dump_factorial.v Normal file
View File

@@ -0,0 +1,10 @@
fn factorial(n u32) u32 {
if dump(n <= 1) {
return dump(1)
}
return dump(n * factorial(n - 1))
}
fn main() {
println(factorial(5))
}