[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How the backquote and the comma really work?
From: |
Michael Heerdegen |
Subject: |
Re: How the backquote and the comma really work? |
Date: |
Thu, 25 Jun 2015 19:33:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Marcin Borkowski <mbork@mbork.pl> writes:
> So, I assume that when Emacs Lisp interpreter encounters a backquote
It's even less mystical: backquote is just a normal macro:
C-h f ` RET
It's also a reader macro so that you can write
`thing
as an abbreviation of of
(` thing)
but that's just a detail.
> If it is a list, its element are read and scanned. If any part of the
> list (probably a nested one) begins with a comma, the whole thing after
> the comma (be it a symbol, a list or whatever) is evaluated as usual,
> and the result is put into the resulting list.
>
> Whew. Is that (more or less) right?
Seems to be a reasonable mental model. Of course, the elements have
already been read by the reader. Whether these are evaluated or not
depends on whether the macro finds the `backquote-unquote-symbol' in
front of them, so to say.
> so a bonus question is: can I find an Emacs Lisp metacircular
> evaluator (taking into account the quoting mechanisms) anywhere?
You don't need a meta thing, since backquote is completely implemented
in Elisp, just read the source code ;-)
Regards,
Michael.
RE: How the backquote and the comma really work?, Drew Adams, 2015/06/25