Search code examples
clojureclojurescript

Unquoting without namespace


I need to quote without namespace and combine it with unquoting. Something like:

'[a b ~c]

Unfortunately, unquoting works only with syntactic quoting:

`[a b ~c]

But then it expands to

[user/a user/b 7]

I would like to expand without namespaces.


Solution

  • What was suggested on clojurians slack channel is as follows:

    Use a combination of "quote unquote" for symbols to get rid of namespaces:

    `[~'a ~'b ~c]
    

    and this works perfectly.