Arc Forumnew | comments | leaders | submitlogin
3 points by andreuri2000 6170 days ago | link | parent

> Is there a technical reason for having back-quote as a separate notation? Why can't an ordinary quote be unquotable? I've always wondered if this is just an onion.

So you can express things like `',x.



1 point by bogomipz 6169 days ago | link

I guess I already knew the answer would have to do with nested quotes, but I see it more clearly now. It's very simple really; what the plain quote buys you is the ability to unquote once instead of twice when using quote inside quasiquote.

Do people that write a lot of macros feel that's such a precious feature?

What's wrong with ''$$x ?

-----

1 point by ehird 6170 days ago | link

'',x

-----

1 point by sjs 6170 days ago | link

But ``,x is certainly not the same as `',x

Here's a macro for illustration:

     (mac a (x y)
      `(do (prn ',x)
           (prn `,y)))
Compared with:

    (mac b (x y)
      `(do (prn ',x)
           (prn `,,y)))

    arc> (a 1 2)
    1
    Error: "reference to undefined identifier: _y"
    arc> (b 1 2)
    1
    2
    2

-----