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

Re: Clarification on named let



Re: ``bindlet'':  Oops.  Ahem.

Re: ``bindrec'': How will a naive user keep it separate in their mind from
``letrec''?

Re: a picky point concerning the expansion of named ``let'':  Actually, the R3RS
expansion is a bit more complex than you said, since the evaluation of the
bound-variable expressions is not in the scope of the name of the ``let'':
	(let name ((i e) ...) b ...)
	((letrec ((name (lambda (i ...) b ...)))
	    name)
	 e ...)

Changing the reserved word that goes at the front of the named-let form will not
in any way simplify the expansion, so I don't much care how complex the
expansion is (at least if we all agree that it's a useful idiom at all).  In
what way will changing the reserved word make teaching this form any easier?

I don't understand Daniel Weise's (rhetorical) question, ``why should such a
simple syntactic modification change the meaning so much?''  As far as I can
tell, the only change to the meaning is that one more name is bound over the
scope of the body.  This is no more major a change than the addition of another
variable/value pair to a normal let.  My very point about the named form of
``let'' is that it is a very minor extension of the semantics.

Please, teachers, answer this question for me:

What goes wrong when you explain named-let as being exactly like the unnamed
kind except that one more thing has been given a name?  That is, we have named
the ``lambda'' that encapsulates the body.  I assume that you do not teach
``let'' as a special form but as a useful abbreviation for an applied
``lambda''.  If this assumption is not true, then that explains much and I
change my question to ``why don't you teach it as an abbreviation?''

Again, I'm not trying to claim that the way you're teaching things is wrong, I'm
trying to understand what breaks down when you try it this way.  I am also a
teacher, but have never taught a course in Scheme, so I'm trying to use your
experience to understand what does and doesn't work in the classroom, and why.

Thank you for your time,

	Pavel