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

junctions and parenthesis

Thread Next
Joseph Brenner
June 22, 2020 02:00
junctions and parenthesis
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About