On the "Squeak Beginners" ML, a new Smalltalker wrote:
> I don't understand why Smalltalk doesn't allow me to have an or:
> method that takes a block argument (except on Boolean).
The answer apparently was that the compiler replaces the code with an
optimization that is usually what one wants, and the actual message never
gets sent:
> Ralph Johnson wrote
> Yes, when the compiler sees exp or: [ ... ] then it assumes that
> "exp" is
> a boolean-valued expression and generates code that fails if it isn't.
I remember the pain of tripping over these little "everything is a message
send to an object*" sins as a new Smalltalker. I wonder now, with the
incredible speed of Cog, Spur, Sista, etc., if these devil's bargains from
prior decades are still necessary. It would be psychologically satisfying
(and nice for newbies) to remove the asterisk from the principle above.