Subject: Re: NBSQ : newbie basic syntax question
From: (Rob Warnock)
Date: 2000/03/05
Newsgroups: comp.lang.scheme
Message-ID: <89spf6$hrvkd$>
Max Hailperin  <> wrote:
| Barry Margolin <> writes:
| > There's no difference for the compiler.  (define (foo a b) ...) is
| > specified to be an abbreviation for (define foo (lambda (a b) ...)), but
| > they mean exactly the same thing.  It's just a stylistic thing.
| One slight exception is that some compilers or interpreters generate
| different (more helpful) debugging information for the abbreviated form.

Yes, some do. But in principle, any compiler (or "interpreter" that always
compiles forms before "interpreting" them) *should* be able to associate
the lambda with the name of the variable that's being defined in the second
case, thus both forms *should* give equivalent debugging detail (unless
the implementor simply chooses not to do that).

On the other hand, this will definitely not give helpful debugging hints,
at least not for "foo" & "bar":

	> (define foo #f)
	> (define bar #f)
	> (let ((x (lambda (a b) ...)))
	    (set! foo x)
	    (set! bar x))

If the compiler stores any name at all with the lambda, it'll probably
be "x"...


Rob Warnock, 41L-955
Applied Networking
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043