[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: What's so cool about Scheme?
Guy Steele wrote:
> On the contrary. In original Lisp, LAMBDA expressions
> were not evaluable constructs at all. Instead, one
> (MAPCAR (QUOTE (LAMBDA (X) ...)) MYLIST)
> Only later, when this piece of list structure beginning
> with the symbol LAMBDA was applied to an argument, was the
> list structure regarded as code and an execution environment
> imputed to it. This delay in regarding the list structure
> as code was the entire source of the FUNARG problem.
Thanks very much for the correction. Sorry Mike, for the misunderstanding.
For the record, I now understand the connection Mike was making between
having a language having eval, and the need for closures.
Is the term "FUNARG problem" then used to refer both to this old Lisp issue
with quoted variable names not being evaluated in their original context, as
well as the case I mentioned where binding does occur in the original
context, but the context is later lost?
For example, at
http://www.stanford.edu/class/cs242/readings/vocabulary.html , it says:
"funarg problem - The failure of traditional stack-based implementations of
procedure calls in the presence of "first-class" functions (functions that
can be passed as procedure parameters and returned as procedure results).
Upwards funarg problem: the problem of returning a function as a procedure
result; requires allocating activation records on the heap and returing a
closure containing a pointer to code and a pointer to the enclosing
activation record. Downwards funarg problem: the problem of passing a
function as a procedure parameter; requires a tree structure for activation
It's definitions like this that led to my misunderstanding. The original
Lisp FUNARG problem seems to me to only marginally qualify under this
definition. The issue in the LISP case doesn't seem to be whether or not
procedure calls are stack-based, etc. - it's simply that there's not even an
attempt to bind values in the original context. This seems like two
completely separate problems to me - the bind-too-late problem (old Lisp),
and the binding-context-lost problem, which seems to me what the above
Is it that in solving the bind-too-late problem, the binding-context-lost
problem came up, and thus both became referred to as the FUNARG problem?