aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test.lisp
blob: 3b9fa5ed115f6612c666107e0a427dd420a7ccf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;; (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])