chialisp 0.5.0

tools for working with chialisp language; compiler, repl, python and wasm bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(defun map-with-rest (F L R)
    (if L
        (c (a F (list (f L))) (map-with-rest F (r L) R))
        R
    )
)

(defun list-len (X) (if X (+ 1 (list-len (r X))) 0))

(defmac map ARGS
    (if (= (list-len ARGS) 3)
        (qq (map-with-rest (unquote (f ARGS)) (unquote (f (r ARGS))) (unquote (f (r (r ARGS))))))
        (qq (map-with-rest (unquote (f ARGS)) (unquote (f (r ARGS))) 0))
    )
)