On Mon, Jun 11, 2007 at 01:43:40AM -0000, NeonGraal wrote:
> Surely if you defined !! to return "undef but true" and both operators
> to be left associative then it all works.
> 
>  1==0 ?? "True" !! "False" -> (undef) !! "False" which seems right to
> me.
> 
>  1==1 !! "False" ?? "True" -> (undef but true) ?? "True" also good.
> 
> TTFN, Struan

Nope.

$a = $b ?? $c !! $c;

If $b is true, you want a to have the value of $c, NOT "$c but true".
Later code may want to use the value of $a in a boolean context.
When the "but true" is added to make the short circuiting work, it
can have longer lasting effects that are not desired.

(I know Larry already agreed with the principle of not mucking
around with simple stuff, but I just wanted to provide a bit
more detail of how said mucking might be a problem.  We don't
need no stinking epicycles upon epicycles. :-)

-- 

Reply via email to