join
Ramon Leon
ramon.leon at allresnet.com
Tue Sep 19 15:24:41 UTC 2006
> 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')
What? Why would you do this, join isn't a method on string, it produces a
string, that doesn't mean it belongs there. Join belongs on Collection or
SequencedCollection. Split and Join are partners, join makes a list into a
string and split does the opposite, join belongs to lists, split belongs to
String.
> 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:
Why do you consider their way the wrong way around?
More information about the Squeak-dev
mailing list
|