Carp/examples/quasiquote.carp
Veit Heller 2023c93d62
feat: Quasiquotation (#1129)
* 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
2021-01-15 10:50:04 +01:00

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)))