diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/spec.lisp | 2 | ||||
| -rw-r--r-- | examples/test.lisp | 26 |
2 files changed, 16 insertions, 12 deletions
diff --git a/examples/spec.lisp b/examples/spec.lisp index 2d870a3..4f4d303 100644 --- a/examples/spec.lisp +++ b/examples/spec.lisp @@ -65,7 +65,7 @@ (let map (\[f lst] (match lst [] [] - (prep (f head lst) (map f (tail lst)))))) + (prepend (f head lst) (map f (tail lst)))))) (print! (map (sum2 1) [1 2 3])) 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]) |
