join

J J azreal1977 at hotmail.com
Sat Sep 23 12:04:58 UTC 2006


I like your previous example the best.  I think smalltalk is different 
enough from the other languages that it needs a "Smalltalk for <language> 
programmers" for the different languages (which it has for some).  Then you 
can just put their join and smalltalks.


>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: Tue, 19 Sep 2006 15:40:11 +0100
>
>It appears to be to be a discrepancy between the smalltalk way and these 
>'other' languages.
>
>in ruby
>
>[ 'a', 'b', 'c' ].join(', ')
>
>in smalltalk to achieve the same thing, including the specification that 
>the result should be a String, arguably could be
>
>' ,' join: #('a' 'b' 'c')
>
>but I can bet that if you are trying to satisfy the aesthetic requirements 
>of users of 'other' languages (those languages with supposedly less 
>brackets), they will take one look at this smalltalk version and say that 
>it is the wrong way around.
>
>so... if you do want the wrong way around for them, we need a right way 
>around for us.
>how about #joining:
>
>aCollection>>join:bCollection
>^bCollection joining: aCollection
>
>#('a' 'b' 'c') join: ', '.
>
>', ' joining: #('a' 'b' 'c')
>
>
>Keith
>
>
>
>
>___________________________________________________________ Copy addresses 
>and emails from any email account to Yahoo! Mail - quick, easy and free. 
>http://uk.docs.yahoo.com/trueswitch2.html
>





More information about the Squeak-dev mailing list