I am banging my head against the wall trying to understand some Clojure macros which use unquote-splice, and I can't seem to find out any clear expanation of whay they are needed. Can anyone explain it to me in dummy terms?
I'm no expert on Clojure, but since it's basically a Lisp, things should be like that unquote-splice is unquote which merges the list to the position where it's used. Difference looks like this:
`(1 2 ~(list 3 4)) => (1 2 (3 4))
`(1 2 ~@(list 3 4)) => (1 2 3 4)
` == syntax-quote
~ == unquote
~@ == unquote-splice
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