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

Named lambdas



    Date: 15-Nov-82 11:22:23 PST (Monday)
    From: Masinter at PARC-MAXC
    That the interpreter/compiled code forgets the name of the function you are
    executing in and/or the debugger has trouble finding it from looking at
    the stack seems more like a lack of functionality on the part of the debugger.
    Enough information is there to determine it 

Consider the following case:

(defun a (x y) ...)

(setq var (fdefinition 'a))

The value of var is now the definition of a, namely, the lambda expression
itself, or named-lambda expression on the Lisp Machine currently.

(funcall var 1 2)

At this point, suppose an error happens inside the body of a's
definition.  There is no way to tell that the function on the stack is
named "a" except because it says so inside it; currently, this is done
with named-lambda, although I agree that a stylized declaration could be
used instead.  But there's no way to get the name "a" from the surrounding
context.

I could come up with more involved cases, involving compiled functions
calling interpreted functions, but you get the idea.