help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How the backquote and the comma really work?


From: Drew Adams
Subject: RE: How the backquote and the comma really work?
Date: Thu, 25 Jun 2015 11:10:51 -0700 (PDT)

> So, I assume that when Emacs Lisp interpreter encounters a
> backquote, it looks at the expression after it.  If it is anything
> but a list, it just works like the usual quote, and the backquoted
> expression evaluates to what was backquoted.

Not really.  A comma (& additional backquotes & additional commas...)
still tells the backquote preceding it to evaluate whatever sexp the
comma precedes.

So `,foo evaluates variable foo, and `',foo evaluates foo and quotes
the result.

(setq foo 'bar)    ; => bar
(setq toto `,foo)  ; => bar
(setq titi `',foo) ; => 'bar

(setq titi `',foo) is equivalent to (setq titi (list 'quote foo))

Michael H's advice about following the macroexpansion is good. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]