Re: split /(..)*/, 1234567890

2005-05-13 Thread Markus Laire
Rick Delaney wrote: On Fri, May 13, 2005 at 04:05:23AM +0800, Autrijus Tang wrote: On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote: Yes, though I would think of it more generally as ('', $0, '', $0, '', $0, ...) where in this case it just happens to be ('', $0) and $0 expands to

Re: split /(..)*/, 1234567890

2005-05-13 Thread Jody Belka
On Thu, May 12, 2005 at 07:13:22PM +0200, Jody Belka wrote: sepsepsepsepsepsep | | | | | | 11 22 33 44 55 66 | | | | | | field field field field field field whoops. add an extra

Re: split /(..)*/, 1234567890

2005-05-13 Thread mark . a . biggar
No, it's not inconsistant. Think about the simpler case split /a/,'a' which return a list of empty strings. Now ask to keep the separators split /(a), 'a' which will return ('', 'a', '', 'a', '', 'a', '', 'a, '', 'a'). Now look at split /(a)/, 'aaab' which returns ('', 'a', '', 'a',

Re: split /(..)*/, 1234567890

2005-05-12 Thread TSa (Thomas Sandlaß)
Autrijus Tang wrote: pugs split /(..)*/, 1234567890 ('', '12', '34', '56', '78', '90') Is this sane? Why the empty string match at the start? -- $TSa == all( none( @Larry ), one( @p6l ))

Re: split /(..)*/, 1234567890

2005-05-12 Thread Autrijus Tang
On Thu, May 12, 2005 at 04:53:06PM +0200, TSa (Thomas Sandla) wrote: Autrijus Tang wrote: pugs split /(..)*/, 1234567890 ('', '12', '34', '56', '78', '90') Is this sane? Why the empty string match at the start? I don't know, I didn't invent that! :-) $ perl -le 'print join

Re: split /(..)*/, 1234567890

2005-05-12 Thread TSa (Thomas Sandlaß)
Autrijus Tang wrote: I don't know, I didn't invent that! :-) $ perl -le 'print join ,, split /(..)/, 123' ,12,3 Hmm, perl -le 'print join ,, split /(..)/, 112233445566' ,11,,22,,33,,44,,55,,66 For longer strings it makes every other match an empt string. With the Positions between chars

Re: split /(..)*/, 1234567890

2005-05-12 Thread David Storrs
On May 12, 2005, at 11:59 AM, Autrijus Tang wrote: On Thu, May 12, 2005 at 04:53:06PM +0200, TSa (Thomas Sandla) wrote: Autrijus Tang wrote: pugs split /(..)*/, 1234567890 ('', '12', '34', '56', '78', '90') Is this sane? Why the empty string match at the start? I don't know, I didn't

Re: split /(..)*/, 1234567890

2005-05-12 Thread Aaron Sherman
On Thu, 2005-05-12 at 12:22, David Storrs wrote: On May 12, 2005, at 11:59 AM, Autrijus Tang wrote: On Thu, May 12, 2005 at 04:53:06PM +0200, TSa (Thomas Sandla) wrote: Autrijus Tang wrote: pugs split /(..)*/, 1234567890 ('', '12', '34', '56', '78', '90') Why the empty

Re: split /(..)*/, 1234567890

2005-05-12 Thread Jonathan Scott Duff
On Thu, May 12, 2005 at 06:29:49PM +0200, TSa (Thomas Sandlaß) wrote: Autrijus Tang wrote: I don't know, I didn't invent that! :-) $ perl -le 'print join ,, split /(..)/, 123' ,12,3 Hmm, perl -le 'print join ,, split /(..)/, 112233445566' ,11,,22,,33,,44,,55,,66 For longer

Re: split /(..)*/, 1234567890

2005-05-12 Thread Uri Guttman
JSD == Jonathan Scott Duff [EMAIL PROTECTED] writes: JSD To bring this back to perl6, autrijus' original query was regarding JSD $ pugs -e 'say join ,, split /(..)*/, 1234567890' JSD which currently generates a list of ('','12','34','56','78','90') JSD In perl5 it would generate a

Re: split /(..)*/, 1234567890

2005-05-12 Thread Jody Belka
On Thu, May 12, 2005 at 06:29:49PM +0200, TSa (Thomas Sandla?) wrote: perl -le 'print join ,, split /(..)/, 112233445566' ,11,,22,,33,,44,,55,,66 [snipped] perl -le 'print join ,, split /(..)/, 11223' ,11,,22,3 Am I the only one who finds that inconsistent? Maybe, but it's because you're

Re: split /(..)*/, 1234567890

2005-05-12 Thread Jonathan Scott Duff
On Thu, May 12, 2005 at 01:12:26PM -0400, Uri Guttman wrote: JSD == Jonathan Scott Duff [EMAIL PROTECTED] writes: JSD To bring this back to perl6, autrijus' original query was regarding JSD$ pugs -e 'say join ,, split /(..)*/, 1234567890' JSD which currently generates a

Re: split /(..)*/, 1234567890

2005-05-12 Thread Larry Wall
On Thu, May 12, 2005 at 12:03:55PM -0500, Jonathan Scott Duff wrote: : I think that the above split should generate a list like this: : : ('', [ '12','34','56','78','90']) Yes, though I would think of it more generally as ('', $0, '', $0, '', $0, ...) where in this case it just

Re: split /(..)*/, 1234567890

2005-05-12 Thread Jonathan Scott Duff
On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote: On Thu, May 12, 2005 at 12:03:55PM -0500, Jonathan Scott Duff wrote: : I think that the above split should generate a list like this: : : ('', [ '12','34','56','78','90']) Yes, though I would think of it more generally as

Re: split /(..)*/, 1234567890

2005-05-12 Thread Autrijus Tang
On Thu, May 12, 2005 at 02:56:37PM -0500, Jonathan Scott Duff wrote: On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote: Yes, though I would think of it more generally as ('', $0, '', $0, '', $0, ...) where in this case it just happens to be ('', $0) and $0

Re: split /(..)*/, 1234567890

2005-05-12 Thread Rick Delaney
On Fri, May 13, 2005 at 04:05:23AM +0800, Autrijus Tang wrote: On Thu, May 12, 2005 at 12:01:59PM -0700, Larry Wall wrote: Yes, though I would think of it more generally as ('', $0, '', $0, '', $0, ...) where in this case it just happens to be ('', $0) and

Re: split /(..)*/, 1234567890

2005-05-12 Thread Autrijus Tang
On Thu, May 12, 2005 at 08:33:40PM -0400, Rick Delaney wrote: On Fri, May 13, 2005 at 04:05:23AM +0800, Autrijus Tang wrote: pugs map { ref $_ } split /(..)*/, 1234567890 (::Str, ::Array::Const) Sorry if I'm getting ahead of the implementation but if it is returning $0 then

Re: split /(..)*/, 1234567890

2005-05-12 Thread Autrijus Tang
On Thu, May 12, 2005 at 08:33:40PM -0400, Rick Delaney wrote: Sorry if I'm getting ahead of the implementation but if it is returning $0 then shouldn't ref($0) return ::Rule::Result or somesuch? It would just look like an ::Array::Const if you treat it as such. ...also note that the $0 here