join

Klaus D. Witzel klaus.witzel at cobss.com
Fri Sep 15 01:43:09 UTC 2006


Hi Avi,

on Fri, 15 Sep 2006 03:31:02 +0200, wrote:
> On Sep 14, 2006, at 6:25 PM, Klaus D. Witzel wrote:
>> Hi Keith,
>> on Fri, 15 Sep 2006 01:57:52 +0200, wrote:
>> ...
>>> any thoughts? I am curious as to why #join: hasn't made it into the  
>>> core image, and if it were to how would it happen?
>>
>> There are several reasons for the absence of #join:
>>
>> - the most important one is, that nobody needs it (or else you would  
>> have found it). Imagine Pearl with the full Squeak Stream hierarchy,  
>> why use join?
>
> Sure we need it.  At Smallthought, we have a package of utility methods  
> that includes:
>
> SequencableCollection>>joinTokens: aString
> 	^ String streamContents:
> 		[:s |
> 		self do: [:ea | s nextPutAll: ea asString] separatedBy: [s nextPutAll:  
> aString]]
>
> Looking through my sends to it, the argument is always either ' ' or ',  
> ', so #joinedWithSpaces and #joinedWithCommas would probably be sensible  
> methods to have too.

No nitpicking intended, the question and the answer was from the  
perspective why Squeak doesn't have it.

But you're right, one counterexample brings my nobody case to fall :)

/Klaus

> Avi




More information about the Squeak-dev mailing list