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

Re: C<::> in rules

Thread Previous | Thread Next
From:
Patrick R. Michaud
Date:
May 14, 2005 13:16
Subject:
Re: C<::> in rules
Message ID:
20050514201712.GA13409@pmichaud.com
On Fri, May 13, 2005 at 01:07:20PM -0700, Larry Wall wrote:
> On Fri, May 13, 2005 at 11:54:47AM -0500, Patrick R. Michaud wrote:
> :     $r1 = rx / abc :: def | ghi :: jkl | mn :: op /;
> :     $r2 = rx / abc ::: def | ghi ::: jkl | mn ::: op /;
> :     $r3 = rx / [ abc :: def | ghi :: jkl | mn :: op ] /;
> 
> I would prefer that $r1 work like $r3, not like $r2, for two reasons.

Now implemented as such in Parrot r8103.  And yes, it now means that

    rx :w /foo/;
    rx /:w::foo/;
    rx /[:w::foo]/;

are all identical, which is very nice.  

> By the way, I still think of it as "a group of alternatives" even
> if there's only one alternative, and no |.  But I can see how that
> can be misread to imply at least two alternatives.  [...]
> And if there's no alternative, you only have one alternative.  
> Ain't English wonderful?

...and this last bit means we can strike the "It is illegal
to use C<::> outside of an alternation" from S05, since we're always
inside of an alternation (group of alternatives), even if there's 
only one alternative.  

That sentence has now been struck.  

Many thanks for the clarification and discussion.

Pm

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