diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2022-09-24 15:59:16 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | 70468c0217e70858bfa037ad81ce8caf1b582ec2 (patch) | |
| tree | d2f4a948b59e5236f59d5c480d1bf2db07ae2b76 /examples/test.lisp | |
| parent | aec05f8d92a608f0fb34fd2453a647b43dcb777d (diff) | |
Implement let
Diffstat (limited to 'examples/test.lisp')
| -rw-r--r-- | examples/test.lisp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/examples/test.lisp b/examples/test.lisp index b41007d..3b9fa5e 100644 --- a/examples/test.lisp +++ b/examples/test.lisp @@ -1,11 +1,15 @@ -(sum2 1 ( - sum2 2 3 -)) ; test1 -;; (sum2 ; test2 -;; 1 -;; 2 ) -;; "string with space" -;; "another \n\"string\"" -;; (let id -;; (\[a] a)) -(\[x] (\[y] (sum2 x y)))
\ No newline at end of file +;; (let map (\[f lst] +;; (match lst +;; [] [] +;; (prepend (f head lst) (map f (tail lst)))))) + +;; (map (+ 1) [1 2 3]) + +(let mapinc (\[vec] + (match vec + [] [] + (prepend + (+ 1 (head vec)) + (mapinc (tail vec)))))) +(env) +(mapinc [1 2 3]) |
