Re: Hyper-concat

2005-06-14 Thread Rod Adams
Juerd wrote: Still, argumentless split probably defaults to something. And ' ' is a good thing to default to, IMO. I like /\s+/ as a default for split better. -- Rod Adams

Re: Hyper-concat

2005-06-14 Thread Juerd
Darren Duncan skribis 2005-06-14 15:12 (-0700): > 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? Array stringification uses it too, by default. The lesser the number of defaults

Re: Hyper-concat

2005-06-14 Thread Darren Duncan
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

Re: Hyper-concat

2005-06-14 Thread Juerd
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 ba

Re: Hyper-concat

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 11:33:21PM +0200, Juerd wrote: : You suggested cat as a join assuming '' in an old thread. I still like : that idea. : : [ '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 pre

Re: Hyper-concat

2005-06-14 Thread Juerd
Larry Wall skribis 2005-06-14 14:15 (-0700): > On Tue, Jun 14, 2005 at 10:31:58PM +0200, Ingo Blechschmidt wrote: > : You can use > : say [~] @array; # "abcd" or > : say @array.join("");# "abcd" or > : say join "", @array;# "abcd" > : if you want to supress the spaces. > I

Re: Hyper-concat

2005-06-14 Thread Larry Wall
On Tue, Jun 14, 2005 at 10:31:58PM +0200, Ingo Blechschmidt wrote: : You can use : say [~] @array; # "abcd" or : say @array.join("");# "abcd" or : say join "", @array;# "abcd" : if you want to supress the spaces. I think a bare @array.join should also work. Larry

Re: Hyper-concat

2005-06-14 Thread Ingo Blechschmidt
Hi, Thomas Klausner wrote: > my $string= >>~<< <1 2 3>; > say $string; > # prints a1 b2 c3 > > But where do the spaces in the second example come from? the spaces come from the stringification of lists/arrays: my @array = ; say [EMAIL PROTECTED];# "a b c d" You can use say [~

Hyper-concat

2005-06-14 Thread Thomas Klausner
Hi! While playing around with some japh-obfus (which turned into my first commit to Pugs, yay!) I spotted this say >>~<< <1 2 3>; # prints a1b2c3 my $string= >>~<< <1 2 3>; say $string; # prints a1 b2 c3 I suppose this is caused by some context things. C imposes list context (as print in Perl