join
J J
azreal1977 at hotmail.com
Sat Sep 30 10:20:14 UTC 2006
Ok, I went and dug it up. I think this was the best proposal for adding
"join" to Squeak 3.10.
>From: Keith Hodges <keith_hodges at yahoo.co.uk>
>Reply-To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Re: join
>Date: Sat, 16 Sep 2006 01:54:50 +0100
>
>I think that join: should be more than a simple string generator. Using the
>power of Smalltalk collections you will find all sorts of wierd and
>wonderful operators that work on all manner of collections, and I think
>that join: should demonstrate some of this power.
>
>avi's joinTokens: aStringToken does just what it say it does, it just
>creates a string. Simple and unambiguous.
>
>My proposed join: implementation is able to do much more, but there are
>some ambiguities as to what behaviour is desired/obtained. I have no idea
>what other Smalltalks do but here are my ideas so far:
>
>Character-useTojoin: result will be a string.
>String-useToJoin: result will be a string.
>$/ useToJoin: #('hello' 'my' 'world') -> 'hello/my/world'
>', ' useToJoin: #('hello' my' 'world') -> 'hello, my, world'
>
>SequencableCollection-useToJoin result will be a SequencableCollection.
>#(1 2) useToJoin: #(3 4 5) -> #(3 1 2 4 1 2 5)
>
>The double dispatch approach can be used.
>
>#('hello' 'my' world') joinUsing: $/
>
>SequenceableCollestion>>joinUsing: joiner
>^ joiner useToJoin: self
>
>----
>ideas:
>
>useToJoin: <-> joinUsing:
>join: <-> joinWith:
>
>Keith
>
>
>
>
>
>
>
>
>
>
>
>___________________________________________________________ NEW Yahoo! Cars
>- sell your car and browse thousands of new and used cars online!
>http://uk.cars.yahoo.com/
>
More information about the Squeak-dev
mailing list
|