Patrick R. Michaud wrote:

Uh oh, I hadn't caught that particular nuance. Is it indeed over the
entire equi-precedential part of the operation, or just over the
chained operators? For example, given


    $x = -1 | 10;

    $ref.meth1($x).meth2($x)

are the meth1 and meth2 calls considered to be "equi-precedential",

I'm not sure that's the right question. I think the question is: what are the relative precedences of "argument list to method call" and "method call on result". And I think it's pretty clear that arg list wins there. So:


    $ref.meth1($x).meth2($x)

 -> any($ref.meth1(-1).meth2($x), $ref.meth1(10).meth2($x) )

 -> any(
        any( $ref.meth1(-1).meth2(-1), $ref.meth1(-1).meth2(10) ),
        any( $ref.meth1(10).meth2(-1), $ref.meth1(10).meth2(10) ),
       )

Or to put it another way: method call isn't n-ary.



And what of ...

    $ref.meth1($x) + $x

are the $x still "tied" to each other even though they're being
used at different levels of precedence?  I.e., do I get

    any( $ref.meth1(-1) + -1, $ref.meth1(10) + 10)

or

    any( any( $ref.meth1(-1) + -1, $ref.meth1(-1) + 10 ),
         any( $ref.meth1(10) + -1, $ref.meth1(10) + 10 ) )

Definitely the latter. As Einstein avowed: "no spooky action at a distance!"

;-)

Damian

Reply via email to