On Fri, 22 Jun 2007 15:40:37 +0100, Aaron Crane wrote:
> Peter Scott writes:
>> can someone tell me why you can't just use && ... || in place of ??
>> ... !!, now that && and || propagate context to both sides?
> 
> You get the wrong result when the antecedent is true and the consequent is
> false:
> 
>   my $a = 1 ?? 0 !! 42;
>   # Now $a is 0
> 
>   my $b = 1 && 0 || 42;
>   # Now $b is [42]

Duh, there it is.

Still curious as to whether their results could preserve lvalueness.

-- 
Peter Scott

Reply via email to