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

Re: named-lambda, etc



The only advantages I see to REC over NAMED-LAMBDA are the ability to
say things like

    (REC SELF
         (VECTOR
	   (LAMBDA ()
	     (LET ((X (FOO)))
	       (VECTOR-SET! SELF 0 (LAMBDA () X))
	       X))))

and the mnemonically useful relationship between REC and LETREC.  (On a close
vote we chose the names REC and LETREC over LABEL and LABELS.)

I see no such advantage to NAMED-LAMBDA over REC.  I use REC fairly often
myself, more often than I use CASE, LET*, or internal DEFINE, but I'd be
willing to give it up and use LETREC instead if that's what it takes to
get NAMED-LAMBDA out of the RRRS.

----------------
I support the idea of collecting stuff specific to S&ICP in an appendix.

----------------
I am probably the person who most likes <?, =?, et cetera, out of regard
for the name formation rules.  As JINX observes, procedure names are less
important than the names of special forms, so I don't care so much whether
<? et al go or stay.

----------------
JINX also writes:
> What I object to is having define by default use REC or NAMED-LAMBDA
> rather than LAMBDA (p 18. MIT AI-Memo 848 version).

This is a real problem when introducing someone to Scheme, because people
who see the (DEFINE (FOO X) ...) syntax quickly infer that it is the same
as (DEFINE FOO (LAMBDA (X) ...)), and you have to tell them that the two
are slightly different but that you can't explain the difference until
they've learned more of the language.  This defeats the very positive
feelings of understanding and mastery that beginning Scheme programmers
would otherwise have.

The main argument that I see for having the alternative DEFINE syntaxes
use REC is that it makes it easier for people to define procedures in
such a way that self-recursive calls can be compiled as simple jumps.
I don't consider this to be a very good argument.

Peace, William Clinger