On Mon, Aug 02, 2010 at 03:41:21PM +0100, Zefram wrote: > Nicholas Clark wrote: > >I can see one potential crafty way to avoid the above inconsistency, which > >is to change sv_2pv_flags() so that it doesnt (completely) cache the string > >conversion for -0. > > Eww. This would violate the truth value rule, by having something that > stringifies as "-0" but is false. Don't do it. And so we go full circle, as you removed the code demonstrating that we already have that bug, only worse: $ perl -wle '$a = 0/-1; print $a ? "T" : "F"; print $a; print $a ? "T" : "F"' F -0 T because we already have it that something that stringifies as -0 may or may not be false depending on side effects of reading it. Nicholas ClarkThread Previous | Thread Next