Nathan Torkington <[EMAIL PROTECTED]> writes:
>Dan Sugalski writes:
>> It's possible, for example, for a tied/overloaded/really-darned-strange 
>> variable to look true but still be false. If you do:
>> 
>>    $foo = $bar || $baz;
>> 
>> and both $bar and $baz are objects, the 'naive' way is to make $foo be 
>> $bar. But it's distinctly possible that $bar really should be treated as a 
>> false value and $baz be used instead. Why? Dunno. Serious hand-waving here. 
>> (And yes, I know that's a danger sign... :) But I don't see any reason to 
>> preclude the possibility.
>
>You can do that right now in perl5, by using overload.pm and supplying
>a 'bool' method.

In practice both Damian and I have been bitten by inability to overload || 
and && - you can indeed pick which side is kept but you cannot make 
it keep both. So "defered" action is not possible.

I can make $a + $b return bless ['+',$a,$b],'OperatorNode' but you cannot
get $a && $b to produce bless ['&&',$a,$b],'OperatorNode' whatever you do. 

-- 
Nick Ing-Simmons

Reply via email to