Add newLisp, our second interpreted lisp implementation that supports f-exprs today, (not in NixOS, but pretty easy to build, so inlined deriviation right in flake.nix). Implemented simple fib/fib-let test.
This commit is contained in:
15
koka_bench/newlisp/newlisp-fib.nl
Executable file
15
koka_bench/newlisp/newlisp-fib.nl
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env newlisp
|
||||
;;
|
||||
;; fibonacci series
|
||||
;; mostly from http://www.newlisp.org/syntax.cgi?benchmarks/fibo.newlisp.txt
|
||||
;; modified slightly to match others
|
||||
;;
|
||||
|
||||
(define (fib n)
|
||||
(cond ((= 0 n) 1)
|
||||
((= 1 n) 1)
|
||||
(true (+ (fib (- n 1)) (fib (- n 2))))))
|
||||
|
||||
(println (fib (integer (main-args 2))))
|
||||
|
||||
(exit)
|
||||
Reference in New Issue
Block a user