develooper Front page | perl.perl6.language | Postings from October 2002

Re: perl6 operator precedence table

From:
Larry Wall
Date:
October 11, 2002 16:42
Subject:
Re: perl6 operator precedence table
Message ID:
Pine.LNX.4.44.0210111627200.25205-100000@london.wall.org
On Sat, 12 Oct 2002, Dan Kogai wrote:
: Objection, your honor.
: 
: perl5 ($x & $y) might be uncommon enough to justify this.  But how 
: about &= vs. &&=, |= vs. ||= ?  Those are both used very often so by 
: saving one symbol we lose consistency.

Ouch.  You're right.  That's a bit of a problem for bits($x | $y) too.

Hmm.

    @a ^|||= 1;
    @a ^bor= 1;
    @a ^.|= 1;

Yow.  Those are all pretty ugly.  But the first one is the least ugly.
And I really do like | for any().  And I can see using it like this:

    @cases ^|= @newcases;

to mean

    for @cases | @newcases -> $x is rw | $y {
	$x = any($x, $y);
    }

Another question is whether using a superposition to represent parallel
streams in "for" is doing the "any" concept too much violence.  Really,
it's more of a hyper-any, at least on the left:

    for @cases ^| @newcases -> $x is rw | $y {...}

But note that ^& automatically gives us the shorter of the two lists.

Maybe...

Just thinking...  :-)

Larry




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