> >         $root->traverse( $sum += __ );
   > 
   > There's a syntactic ambiguity here. I assumed that __ "poisons" an
   > expression so that an entire parse tree gets transformed into a
   > closure. If you isolate the parse tree based on expression precedence,
   > then I'm not sure why the += example works.

Sorry, I finally found a moment to sit down and clarify this point.

The error was not here but in:

   __ < 2 + __ * atan($pi/__) or die __

That should of course have been:

   __ < 2 + __ * atan2($pi, __) or die __

(I meant to write it that way, but my brain has a mind of its own sometimes!)

A __ only "poisons" an expression/sub call if it is a direct operand/argument.

So:
        atan($pi/__)

is:

        atan( sub{$pi/$_[0]} );

whereas:

        atan2($pi,__)

is:

        sub{ atan2($pi,$_[0]) };


I'll make it clearer in version 2 of the RFC.

Damian

Reply via email to