At 12:01 AM +0200 6/15/05, Juerd wrote:
Larry Wall skribis 2005-06-14 14:54 (-0700):
 :     [ 'a' .. 'e' ].join   # "a b c d e"
 :     [ 'a' .. 'e' ].cat    # "abcde"
 I had forgotten that.  Yes, there is a little something to be
 said for preserving the (mostly false) symmetry of split and join.
 I think I argued for .cat on the basis that it also gives us cat as
 a list operator.  But these days that's just [~], so at the moment
 I'm inclined to stick with argumentless .join doing concatenation,
 especially since I'd like to undo the split(' ') special case anyway
 and use a different notation for word splitting.

Still, argumentless split probably defaults to something. And ' ' is a
good thing to default to, IMO. It doesn't have to be a special case. In
fact, it not being a special case makes the symmetry less false, and
would --if ' ' is the default-- make the case even stronger for join to
default to ' ' too.

I think that '' is the best default case for both split and join in Perl 6.

They would be symmetrical because they are both ''.

And the space character is really a rather arbitrary looking value for a default and is equally valid with, say, the line break, so how can one say it is better?

-- Darren Duncan

Reply via email to