in reply to Re: An infix fix
in thread An infix fix

And, they will be in Perl6.

And they will have the much better name of Junctions. See Synopsis 9 and 3 for more info. They also currently work in Pugs as well:

#!/usr/bin/pugs use v6; if ( undef() & 2 & 0 & 'x' ) { print "They're all true!\n"; } else { print "At least one is false!\n"; } if ( undef | 2 | 0 | 'x' ) { print "At least one is truee!\n"; } else { print "They're all false!\n"; }
NOTE: The undef() in the first 'if' currently needs to be there or it confuses the parser, this is a Pugs-Bug though, so it will be fixed eventually.

-stvn

Replies are listed 'Best First'.
Re^3: An infix fix
by MidLifeXis (Monsignor) on Mar 22, 2005 at 18:29 UTC

    I see a difference between this and the any() / all() usage. How would you do

    if (all(@results)) { ... }

    using the

    if (x & y & z) { ... }

    style of coding it?

    /me is asking a question just in case I am missing something, since I don't see the relation between the two styles. One can process a list, the other cannot.

    --MidLifeXis

      You cannot actually. You do Junctions on lists by using the any()/all()/one() functions. Which correspond to the '&', '|' and '^' Junction operators. You can see some tests for this here. If you look in the 'misc_junctions.t' file, you will see some examples of any()/all() and one().

      -stvn