On Thu, May 12, 2005 at 12:06:57AM +0800, Autrijus Tang wrote:
> On Wed, May 11, 2005 at 08:30:42AM -0700, Larry Wall wrote:
> > On Wed, May 11, 2005 at 05:48:59PM +1000, Damian Conway wrote:
> > : But that's only the opinion of one(@Larry), not of $Larry.
> > 
> > Let's go 0-based and make $0 =:= $/[0] so that $/[] is all the parens.
> > Our old $0 (P5's $&) could be $<> instead, short for $<MATCH> or some
> > such.
> 
> Both 0-based $0 etc and $<> are now implemented in Pugs.

$0 is also in PGE, $<> will wait for a more definitive statement.

> > I wonder how much call there will be for a rule option that uses P6
> > syntax but P5 paren binding with "push" semantics.
> 
> Should it be an rule option, or simply an alternate way to address
> the content in $/?  Something like $/.flattened_matches[10], perhaps?

Could be, although I'd prefer $/.lparens  or something like that,
to make it clear we're counting left parens.  "Flattened_matches"
sounds to me like we're flattening all of the captures into a single
list.  But then again, "lparens" looks odd when presented with 
something like:

    / $7:=[\s+] /

since there really aren't any lparens there.  Maybe $/.perl5[10] . :-)

To make things work this way, PGE will have to tag match objects
along both the nested and non-nested lexical scopes of the rule pattern.
Not too big an issue--just more bookkeeping to keep track of.

OTOH, since :perl5 is already flattening its paren captures,
there's precedent for doing this sort of thing as a rule option.
It may make more sense to request "flatness" within the rule 
as opposed to (in addition to?) the returned match object.

Pm

Reply via email to