List Info

Thread: Re: Fix 'abs' and 'neg' overloading for 64-bit ints (revised)




Re: Fix 'abs' and 'neg' overloading for 64-bit ints (revised)
user name
2007-10-10 04:21:44
I'd like to delay application of this patches and the
related ones to
come until 5.10.0 is out. (64-bit testing is hard, due to
the many
configurations and hardware involved)

On 09/10/2007, Jerry D. Hedden <jdheddencpan.org> wrote:
> This is my first patch for tackling the 64-bit int
overloading issues.
>  It corrects the behavior of 'abs' and 'neg' (unary
minus):
>
> perl -lwe '{ package t0; sub mynum  use overload
> "0+" => &mynum, fallback => 1; }
printf "%dn", abs(t0::mynum);
> printf "%dn", abs(bless({},
"t0"))'
>
> perl -lwe '{ package t0; sub mynum  use overload
> "0+" => &mynum, fallback => 1; }
printf "%dn", -&t0::mynum; printf
> "%dn", -bless({}, "t0")'
>
> I revised the patch to treat refs as UVs which made
more sense to me.
> Please check my work and provide feedback.  Thanks.
>
>

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )