language: prelude and internal functions, and varargs support

This commit is contained in:
2023-09-10 19:27:59 -04:00
parent 1cfb197a7f
commit e8c984f2dc
24 changed files with 166 additions and 104 deletions

View File

@ -1,17 +1,13 @@
/* fibonacci sequence */
func fib(n) {
if n == 0 {
0
if n < 2 {
n
} else {
if n == 1 {
1
} else {
fib(n - 1) + fib(n - 2)
}
fib(n - 1) + fib(n - 2)
}
}
export func main() {
let result = fib(20)
let result = fib(30)
println(result)
}