[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Label is useful and should stay in Lisp.
- To: KMP at MIT-MC, (BUG LISP) at MIT-MC, BKPH at MIT-MC
- Subject: Label is useful and should stay in Lisp.
- From: MACRAK at MIT-MC (Stavros M. Macrakis)
- Date: Fri, 21 Dec 79 21:39:00 GMT
- Original-date: 21 DEC 1979 1639-EST
I was wrong about Label being the only way to write pure recursive Lisp,
given Funcall, which I agree is nice, but on the other hand is not in
Lisp 1.5, and is not universal Lisp. But I won't quibble about this.
I stand on my statement that Label is useful and even an integral part
of Lisp. Conceptually, it is different to Lambda-bind an atom to a function
and to Label-bind it to one. One of the problems is the scope of the binding.
How do you write a FUNCTION (as opposed to a function application) with
this recursion? The ways I can think of are rather clumsy, since the
outermost lambda must name the lambda-variables:
(lambda (a b)
((lambda (f) (funcall f a b))
'(lambda (a b) ...(funcall f ...)...))).
This seems clumsy to me compared to:
(label f (lambda (a b) ...(f ...)...)),
since you have to write the lambda-list twice, and repeat it to pass it
along, and then use (funcall f ...) through the whole body instead of (f ...).
The basic problem is that f is no longer a FUNCTION within the body, but
rather a variable representing a function: a concept which is more appropriate
for functional arguments, for instance.
Since one of the strengths of Lisp is the concept of Function, it seems
a pity to emasculate it.
I agree entirely that the current implementation of Label is a crock, but
then so are a lot of other things. Consider Store, for instance, or
Pseudo-Funargs. I would be much happier with a better implementation, but
terribly unhappy not to have Label at all.