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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Jun 20 13:49:08 UTC 2010


One danger with this approach is that every different application may
have its own idea of how to convert some object into an Array.

For example (1 at 3) asArray could be {1 at 3} as well as #(1 3) for some
applications, simply because there is an argument I'd like to be both
a Point or a Collection...

I see some relation with this:
http://gbracha.blogspot.com/2010/06/patterns-as-objects-in-newspeak.html

Nicolas

2010/6/20 Brent Pinkney <brent at zamail.co.za>:
> Hi,
>
>> 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.
>
>
> Brent
>
>



More information about the Squeak-dev mailing list