join
Lex Spoon
lex at cc.gatech.edu
Mon Sep 18 09:52:01 UTC 2006
Avi Bryant <avi.bryant at gmail.com> writes:
> Sure we need it. At Smallthought, we have a package of utility
> methods that includes:
>
> SequencableCollection>>joinTokens: aString
Scala's library has a similar method. I thought it was the silliest,
overly specific method I've seen, but then I keep finding myself using
it!
> Looking through my sends to it, the argument is always either ' ' or
> ', ', so #joinedWithSpaces and #joinedWithCommas would probably be
> sensible methods to have too.
This is my experience, too.
It seems people just cannot resist the urge to generalize this method
more than is useful. We've all taken too *many* programming classes,
and are overlooking some pragmatics!
Scala's method is actually more general than the join: methods being
passed around -- it takes in an initial string and a final string as
arguments -- but I find myself always setting those to the empty
string...
-Lex
More information about the Squeak-dev
mailing list
|