What's in an Emacs Lambda?
nullprogram.com
What's in an Emacs Lambda?
1–6 of 6 posts
Re: What's in an Emacs Lambda?
#2Re: What's in an Emacs Lambda?
#3 '(lambda (x) x)
is actually shorthand for (quote (lambda (x) x))
And then the distinction between them is explained right inside emacs. C-h f quote and C-h f lambdaRe: What's in an Emacs Lambda?
#4The difference is when an expression is to be evaluated. Back quote and friends are evaluated by the read function. These expressions are (or at least should be) functions on syntactic forms - syntax transformers. People call them macros. Of course they could have been misused in many cryptic ways.
I don't really agree with this. Backquote is just shorthand for a bunch of consing that makes the end result more clear. Macros are one application where being able to sort of template lists is very useful, but they're not the only one. As well, I think the tendency for people to learn backquote as a companion to defmacro tends to confuse people about how defmacro works.
Re: What's in an Emacs Lambda?
#5The difference is when an expression is to be evaluated. Back quote and friends are evaluated by the read function. These expressions are (or at least should be) functions on syntactic forms - syntax transformers. People call them macros. Of course they could have been misused in many cryptic ways.
> These expressions are (or at least should be) functions on syntactic forms - syntax transformers. I don't really agree with this. Backquote is just shorthand for a bunch of consing that makes the end result more clear. Macros are one application where being able to sort of template lists is very useful, but they're not the only one. As well, I think the tendency for people to learn backquote as a companion to defma…
Re: What's in an Emacs Lambda?
#6The difference is when an expression is to be evaluated. Back quote and friends are evaluated by the read function. These expressions are (or at least should be) functions on syntactic forms - syntax transformers. People call them macros. Of course they could have been misused in many cryptic ways.
> These expressions are (or at least should be) functions on syntactic forms - syntax transformers. I don't really agree with this. Backquote is just shorthand for a bunch of consing that makes the end result more clear. Macros are one application where being able to sort of template lists is very useful, but they're not the only one. As well, I think the tendency for people to learn backquote as a companion to defma…
For CL it is entirely valid to implement whole logic of backquote in the ` read macro and expand it into some nested combination of list, append and quote at read time. Scheme specifies what ` and friends expand into which then is implemented as normal m8acros (which is also valid and somehow common implementation in CL). Elisp is slightly weird in that ` originally was normal macro and thus ` read macro expands `(foo) into (` foo).