How should I unquote in the following:
(def a '(1 2 (+ 1 2)))
So that it evaluates to:
(1 2 3)
Doing a:
(def a '(1 2 ~(+ 1 2)))
evaluates as below in the REPL:
(1 2 (clojure.core/unquote (+ 1 2)))
I know I can do a:
(list 1 2 (+ 1 2))
But I was wondering whether there might be some syntax for the purpose.
Use `
instead of '
. Unquoting does not work with '
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With