Re: Announcing E 0.8.4: The Birthday Release Dan Bornstein (danfuzz@milk.com)
Tue, 1 Jun 1999 17:00:42 -0700 (PDT)

Mark S. Miller writes:
>>* visitObjectExpr, visitPlumbingExpr: I find the definition of these nodes
>>to be disturbing in that they combine object definition with variable
>>binding. You already have a "define" primitive which should cover the
>>variable binding side of things. Maybe you still need primitives to cover
>>the object definition part of these (maybe not--again, I apologize for not
>>being sure enough of the sementics), but at least you could consolidate
>>the "define" part.
>
>[-] I have lost my faith in anonymous closures.
>I have made the name of the variable being defined part of the object
>expression, so that this object expression will know this name. The minor
>but pleasant user interface payoff: If the object does not provide its own
>printOn method, a Miranda method will be provided for it that will print
>using that name:

[+] Understood and agreed, sort of. One of the MIT extensions of Scheme is named-lambda, which is just like (unnamed) lambda except that you provide a name in addition to everything else, which is used when printing out the result of evaluating the expression, intended for debugging, but clearly useful in the world of persistence. I intend to add named-lambda to my Scheme, but I don't intend to add a new special define primitive. Here's what I'll be doing (mo/less):

(define (name arg1 ... argn) body)
=>
(primitive-define name (named-lambda (name arg1 ... argn) body))

Yes, the name gets duplicated in the translation, but it makes it manifestly clear that the name of the variable that the object is bound to has nothing necessarily to do with the internal name for the object, as your example elucidates quite nicely:

> ? define bletch {
> > //...
> > }
> # value: <bletch>
>
> ? define zorch := bletch
> # value: <bletch>
>
> ? zorch
> # value: <bletch>

-dan