Larry Wall <[EMAIL PROTECTED]> writes:
>: At 06:20 PM 4/20/2001 -0300, Filipe Brandenburger wrote:
>: >Please tell me if there really is an use for overloading && and || that 
>: >would not be better done with source filtering, then I will (maybe) 
>: >reconsider my opinion.
>
>I think it's a category error to talk about overloading && and ||,
>which are not really operators so much as they are control flow
>constructs.  

I want to be able to "overload" those as well ;-)

>You really have to talk about overloading boolean context
>in general.

Only if you are going to execute the result in the normal perl realm.
Consider using the perl parser to build a parse tree - e.g. one to 
read perl5 and write perl 6. This works for all expressions except
&&, || and ?: because perl5 cannot overload those - so 

$c = ($a && &b) ? $d : $e;

calls the bool-ness of $a and in the defered execution mode of a translator
it wants to return not true/false but "it depends on what $a is at run-time".
It cannot do that and is not passed $b so cannot return 

   new Operator::->('&&',$a,$b)




-- 
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.

Reply via email to