mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
* feat: quasiquotation * test: add tests for quasiquotation * fix: fix typo in call to doc * fix: do not evaluate quasiquote too eagerly * test: pull quasiquote test into macro * docs: fix unquote example with better constant * feat: add quasiquote literals * refactor: simplify reader macros
10 lines
176 B
Plaintext
10 lines
176 B
Plaintext
(defdynamic x 1)
|
|
(defdynamic y '(1 2))
|
|
|
|
(defmacro gen-sum []
|
|
(quasiquote
|
|
(+ (unquote x)
|
|
(+ (unquote-splicing (map inc y))))))
|
|
|
|
(defn main [] (println* (gen-sum)))
|