emacs-devel
[Top][All Lists]
Advanced

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

Re: Backquote


From: Stefan Monnier
Subject: Re: Backquote
Date: Tue, 11 Apr 2006 23:37:34 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> To understand how ` works, I read lisp/emacs-lisp/backquote.el.
> And I found:

>    ;; When the Lisp reader sees `(...), it generates (\` (...)).
>    ;; When it sees ,... inside such a backquote form, it generates (\, ...).
>    ;; For ,@... it generates (\,@ ...).

> Do all Lisp readers have this feature?

More or less.  It's just a generalization of the original mapping from '<e>
to (quote <e>).  What the , ` and ,@ expand to depends on the specific
flavor of Lisp.  I don't know what it is in CommonLisp, but in Scheme `<e> is
(quasiquote <e>), ,<e> is (unquote <e>), and ,@<e> is (unquote-splicing <e>).

There may also be differences in the details: in Emacs Lisp, ,<e> only maps
to (\, <e>) if it occurs within a `<e>, whereas I think this mapping is done
unconditionally in most other Lisps.

> And is behavior of backquote in GNU Emacs similar to other Lisp
> implementations, especially for nested backquotes?

Yes.  Tho it depends which version of Emacs Lisp: the behavior of nested
backquotes was changed in Emacs-CVS (the change makes it behave more like
other Lisps and is clearly just a bugfix).


        Stefan




reply via email to

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