join
Keith Hodges
keith_hodges at yahoo.co.uk
Tue Sep 19 14:40:11 UTC 2006
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
|