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

"DEFLET"?



Maybe the reason we're having such problems picking a name for this thing is
that it was a bad abstraction in the first place.  While it is syntactically
like LET, the binding it does is very different.  In 

(LET ((id1 val1) (id2 val2) ...) body)

the id's are bound, whereas in

(LET name  ((id1 val1) (id2 val2) ...) body)

name is the variable which is bound.  The id's are bound momentarily to the
val's when name is invoked, but that is temporary.

In anonymous LET, the binding is an efficiency hack which implements the
textual substitution

body[vals/ids]  

[mod side-effects, etc, which are surely irrelevant.  Another irrelevant aside
is that the typing rules in ML treat LET as if it did the substitution.]

In named LET, no such textual interpretation seems possible.  The name seems
to have arisen purely from the syntactic similarities of

((LAMBDA (id1 ...) body) val1 ...)
and
((REC name (LAMBDA (id1 ...) body)) val1 ...)

The abstraction seems to be: create a local procedure (recursion, iteration,
recurrence, whatever), and invoke it on some values.

Maybe we should redesign the syntax to more properly represent what's going
on:

(INVOKE-LOCAL (name ((id1 &INITIALLY val1) (id2 &INITIALLY val2) ...))
	body)

:-)  --Mitch