diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/countdown.nxs | 7 | ||||
-rw-r--r-- | doc/main.nxs | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/countdown.nxs b/doc/countdown.nxs new file mode 100644 index 0000000..c28fc7f --- /dev/null +++ b/doc/countdown.nxs @@ -0,0 +1,7 @@ +(bind countdown + (lambda (n) + (if (= n 0) + 0 + ((lambda (continue) + (continue (- n 1))) countdown)))) +(countdown 10) diff --git a/doc/main.nxs b/doc/main.nxs index 76fc95f..381161a 100644 --- a/doc/main.nxs +++ b/doc/main.nxs @@ -1,5 +1,6 @@ (include "fib.nxs") + (bind factorial (lambda (n) - (if (= n 0) 1 (* n (factorial (- n 1)))))) + (if (= n 0) 1 (* n (factorial (print(- n 1))))))) (fib 7) (+ (factorial 5) 10) |