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

'(LAMBDA ...)



I might also note that there are users who think it's acceptable to type
'(LAMBDA ...) because it's supported as a compatibility thing.

In the past few months I spent a lot of time looking over a certain 
large system which had been written for Maclisp and transported to the LispM 
and which ran far slower than was considered reasonable. In poking around,
I noticed that 20% of the time was being lost to calls to EVAL in what I
thought was to be a compiled system. I later found that this was because 
someone was putting '(LAMBDA ...) instead of #'(LAMBDA ...) and was therefore
not getting compiled code in some places that desperately needed it. If the
evaluator had just been firm and disallowed quoted lambdas as funcallable
things, it'd have caused a minor amount of grief getting the system up, 
but everyone would have been much happier in the long run.

The convenience, it seems to me, should be disallowed to wake people up
to the fact that a quoted lambda is going to win only in just enough
cases to give the illusion of safety and in general is just going to
cause any number of unexplained slowdowns or mysterious binding problems
as suggested by EAK.

Asking implementors to disallow (LAMBDA ...) as a function is a bit extreme
for common-lisp, but making it undefined in the common-lisp spec and 
encouraging implementors to disallow it seems a reasonable approach.

I also agree with EAK that
 (defmacro lambda (bvl &body body) `#'(lambda ,bvl ,@body))
is a winning abbreviation.