Keith Braithwaite has an excellent article up on the "magic" enabled by having objects all the way down. He uses the classic explanation: how #ifTrue:ifFalse: works in Smalltalk:
Anyway, imagine that Java were an OO language and that if, therefore, were a method. There would be a potential problem (assuming the near universal eager evaluation of function arguments). Our imagined ObjectJava code might look like this:
if(condition, {doOneThing();}, {doAnotherThing();});
which kind-of suggests that both the one thing and the other would get done.
...
The syntax of our invented ObjectJava is pretty bad there, );}); isn't a thing of beauty, although it's not much worse than the way some real Java looks. The Smalltalk equivalent is much neater. Continuing with our janitorial example:
aDoor isAlarmed ifTrue: [self disarm: aDoor] ifFalse: [self openNormally: aDoor].
It doesn't look a lot different, but the fun is in the implementation (which is right there in the base libraries, not baked into the language syntax:
ifTrue: t ifFalse: f
^ t value
ifTrue: t ifFalse: f
^ f value
As Keith says, the beauty of that is this: the power involved in having that in the standard library is not closed off as a "language implementor only" feature - anyone can create code like that, and it ends up living at the same level as other library code. For instance, there's a method in the Collection library called #select:, which is used like this:
someCollection select: [:each | "each object that satisfies the condition here ends up in a new collection"].
That answers a new collection, where the members satisfy the boolean condition in the block. Want a new collection method that can be used against any collection? Just go ahead and add it to class Collection and boom - there it is, same level as #select:. No "helper" classes, no piles of code to get around the fact that it wasn't where it belonged. Going back to Keith's article:
Perhaps most astonishing about the Smalltalk approach is that Boolean values and selecting different actions based upon them is not part of the language. These are facilities provided by methods of classes in the Smalltalk standard library! This library (the "standard image") turns out to contain a large number of overlapping Embedded Domain Specific Languages--one of which, provided by the classes Boolean, True and False is specific to the domain of two-valued logic. That's a very remarkable thing. Most remarkable is what it says about the business of writing programs in Smalltalk.
There is no mechanism available to the Smalltalk programmer to create programs other than the creation of EDSLs
What that means is that the DSL tools that many vendors - like Microsoft - are pounding sand to create in languages like C# and Java - can be easily created in Smalltalk. Just ask Steve Kelly. Smalltalk isn't just another language - it's a level up, where you can set your amp to 11.