develooper Front page | perl.perl6.users | Postings from June 2020

junctions and parenthesis

Thread Next
From:
Joseph Brenner
Date:
June 22, 2020 02:00
Subject:
junctions and parenthesis
Message ID:
CAFfgvXXoDQADK0waQw26jZtHfBZ6ktZ-zb2yTHx_6MZukVqu-g@mail.gmail.com
I was just playing around with junctions a bit today, and I
noticed that if you weren't religious about using parenthesis
with them you could get quietly tripped up:

    say so any(<a b c>) eq any(<c d>);   # True   (as expected)
    say so any(<a b c>) eq any(<d e f>); # False  (as expected)
    say so any <a b c> eq any <c d>;     # False    (something's wrong)

Basically, you need the parens on that first use of any.

Is there a reason you don't at least get a warning if you don't?

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