On Sep 14, 2007, at 3:51 PM, Alan Kay wrote:
Re: unification of blocks and methods (procedures).
I first saw this in EULER (Wirth and Weber ca 1966), but then saw an earlier similar notion by Landin in ISWIM and its predessors. I used the idea in my first OOP language (FLEX ca 1967-9), which also had complete static nesting of scopes, etc.
But later I decided I didn't like blocks as values because they are super time bombs when passed around and completely violate encapsulation. I really wanted external objects (not internal blocks) to be passed around, and wanted a simpler way to think of contexts internally. So we left them out of the first few Smalltalks. (I still don't like them ...)
I am glad I am not completely alone in my dislike of, or shall we say: discomfort with blocks.
Of course, if you are going to have blocks, then unifying the two concepts is quite obviously a good thing (IMHO). A block is just an unattached/anonymous method body and a method just a block with a name that's attached to a class. However, with that unified view it becomes immediately obvious that there is something wrong with blocks. After all, we don't directly call methods in other cases, that's early binding and a Bad Thing. Instead we send messages to objects. How does not naming the method body make this type of early binding and leaking implementation better?
On the other hand, having blocks is vastly superior to not having any useful higher order mechanism, and blocks are extremely powerful. Possibly too powerful, one of those "better old things" (lambda/ anonymous functions) that is so useful and powerful that it stops us looking for the actual "new" thing.
Marcel
p.s.: your message about the Internet being an OO system didn't reach me, I only just saw it on the list archives. I obviously(?) agree wholeheartedly, it is an OO system, but one that is quite different from Smalltalk. And the way to make things gel is probably not to try to "extend the image" (distributed Smalltalk, NetMorphs [as cool as they are], CORBA, SOAP), but rather to bring "the net" into "the image" in a deep way. Well, it probably wouldn't be an image as we think of it.