Larry wrote:

That's the basic problem with

    0 < $x < 10

after all--the problem with rewriting that as

    0 < $x and $x < 10

is that it should only work as long as the two values of $x remain
entangled so that the always refer to the same abstract value.

That's certainly true. But I think the real problem there is in mistakenly treating Perl 6 comparators as binary ops (with n-ary sugar), rather than as genuine n-ary ops.


That is, a junction must autothread early, and over the entire operation (or at least, over the entire equi-precedential part of the operation) in which it's used.

So if:

      $x = -1 | 11;

then:

      10 < $x < 0

-->   any(10 < -1 < 0, 10 < 11 < 0)

-->   any(10 < -1 && -1 < 0, 10 < 11 && 11 < 0)

-->   any(false, false)

The mistake is in thinking that the n-ary comparison should be expanded before the junction autothreads.

Damian



Reply via email to