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

named lambdas



In NIL, a subr (compiled-code object) is the only thing which is allowed
to go into a function cell.  There is mediation performed by FSET to
handle this.  SUBRs for compiled functions have the function name in them.

Interpreted DEFUN does an FSET of the name to an interpreter-closure,
which also has the function name in it.  FSYMEVAL on the name returns
the closure (not the trampoline subr).  Although FLET doesn't happen
to do this because it is currently a macro which expands into a different
NIL binding construct, it could be written as a special form which
also stored the name in the closure.

So, does FDEFINITION want to return the lambda expression of a defun,
or the closure?  Is it different from FSYMEVAL on a symbol?  Looks
like the function cell of your typical interpreted function is going
to have to have an interpreted-lexical-closure in it, so it looks like
everything of interest is going to be encapsulated somehow by
something which would be a more appropriate place for the name.

I'm not really trying to argue against named-lambdas.  That would be
hypocritical since i recently put them into NIL, although they haven't
been exercised and i may have missed a couple places (especially in
the compiler, but that's going away anyway).  But it seems that the
problem they solve might not actually occur that much now.