[squeak-dev] The Inbox: Kernel-cmm.464.mcz

Brent Pinkney brent at zamail.co.za
Sun Jun 20 13:16:39 UTC 2010


> maybe #inArray or #asSingleton would be more appropriate: it is not a
> conversion, it is an encapsulation.

Nope, Chris is right. #asArray (and #asCollection) belong in Object and add a 
lot to promoting terseness in Squeak.

Since Smalltalk does not support multi-methods, it is essential that the 
caller of a method can pass arguments in multiple formats to the same method 
and have them correctly interpreted by the implementation.

Remember- the computer works for the user, not the other way around.

For those interested in a pattern, the Chronology implementation uses
#asDateAndTime gratuitously , for similar _significant_ improvements in 
terseness and readability.

I find it deeply offensive when using String>>#format: to _have_ to  make and 
pass an array when my string only has one {1} subsctitution field. Silly little 
languages like C# allow multi-methods.


More information about the Squeak-dev mailing list