On Tue, Apr 01, 2003 at 08:26:38PM -0500, Joe Gottman wrote:
: Is there any way to write a user-defined operator so that it
: short-circuits, like && and || ? This might be function trait, for
: instance,
:
: sub infix:!! ($lhs, $rhs) is short_circuit {...}
Honestly, you guys. You make things so hard for yourselves. I don't
see why that wouldn't just be:
sub infix:!! ($lhs, &rhs) is equiv(&infix:||) {...}
All closures are lazy by definition, and the &rhs forces the right
side of !! to be a closure. At worst, we'd have to change "sub"
to "macro" to give a special parsing rule to the right side.
Larry