develooper Front page | perl.perl6.language | Postings from May 2005

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

Thread Previous | Thread Next
From:
Rick Delaney
Date:
May 12, 2005 17:34
Subject:
Re: split /(..)*/, 1234567890
Message ID:
20050513003340.GA17339@biff.bort.ca
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 ['12','34','56','78','90'] if you treat it as an array.
> 
> Thanks, implemented as such.
> 
>     pugs> map { ref $_ } split /(..)*/, 1234567890
>     (::Str, ::Array::Const)

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.

-- 
Rick Delaney
rick@bort.ca

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About