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

named lambdas



FDEFINITION on a symbol should be the same as FSYMEVAL.

What you get if you do (PRINT (FDEFINITION foo)) necessarily has to be
implementation-dependent, it appears.  So in that sense NAMED-LAMBDA should
not be in Common Lisp, nor should LAMBDA.  Two exceptions to this:

The user should be given certain portable operations on functions,
including extracting their name.  In the case of interpreted functions it
should also be possible to extract the argument list and the body.

The user should be able to construct functions using more primitive
mechanisms than DEFUN.  One way to do this is to say that any list starting
with LAMBDA is acceptable as a function, and will be translated into
whatever the implementation wants.  Storing this function with FDEFINE and
then retrieving it with FDEFINITION will not, in general, return the same
object.  One could accept NAMED-LAMBDA at this level, too, although I like
JonL's idea for flushing it.  Another way would be to add a new primitive
MAKE-FUNCTION.

To do this right requires a portable specification of the behavior of
the interpreter's representation of a lexical environment.