Re: #' and lambda
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Fri, 10 Feb 2006 20:26:23 -0500
In article <Lr3Hf.548096$084.324960@attbi_s22>,
Brian Downing <see-signature@xxxxxxxxx> wrote:
Having the LAMBDA macro makes one think that evaluating LAMBDA itself
returns a function object, which makes the ((lambda ...) ...) syntax
seem really out of place - if it evaluates its CAR, why doesn't
anything else?
The reason this isn't much of a problem is that ((lambda ...) ...)
syntax is virtually never used any more. It was used decades ago,
before LET was created, but now it has little practical use (I can't
think of any reason to use it offhand). Maybe there are some macros
that have some reason for expanding into a call to a lambda rather than
a LET expression -- there are some slight differences in the effect of
declarations at the head of the body (which is why LET is no longer
simply a macro that expands into a call to the corresponding lambda
expression, as it was in MACLISP).
(That being said, I usually wind up leaving the sharpquote off lambda
without even thinking about it. :-)
As a corollary of what I said above, in modern code (LAMBDA ...) is
never used without being preceded by sharpquote. So there seems to be a
redundancy. All the other uses of #' are necessary to indicate how the
function name should be evaluated -- as a function name or with ordinary
expression evaluation -- but there was no "ordinary expression
evaluation" for a lambda expression. Since LAMBDA was available as an
operator name, they decided to just use it to conflate this redundancy.
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- Follow-Ups:
- Re: #' and lambda
- From: Joerg Hoehle
- Re: #' and lambda
- References:
- #' and lambda
- From: verec
- Re: #' and lambda
- From: verec
- Re: #' and lambda
- From: Duncan Harvey
- Re: #' and lambda
- From: verec
- Re: #' and lambda
- From: Brian Downing
- #' and lambda
- Prev by Date: Re: sbcl - how to get a REPL for a created thread?
- Next by Date: Re: #' and lambda
- Previous by thread: Re: #' and lambda
- Next by thread: Re: #' and lambda
- Index(es):
Relevant Pages
|