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

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

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
May 12, 2005 18:17
Subject:
Re: split /(..)*/, 1234567890
Message ID:
20050513011727.GA50926@aut.dyndns.org
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 shouldn't ref($0) return ::Rule::Result or somesuch?  It would
> just look like an ::Array::Const if you treat it as such.

Er, where does this ::Rule::Result thing come from?

I was basing my implementation on Damian's:

    Quantifiers (except C<?> and C<??>) cause a matched subrule or
    subpattern to return an array of C<Match> objects, instead of just a
    single object.

As well as the PGE's implementation of treating the quantified capture as a
simple PerlArray PMC.

Thanks,
/Autrijus/

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