unsigned policy
Sean Kelly
sean at f4.ca
Wed Feb 7 20:42:02 PST 2007
Andrei Alexandrescu (See Website For Email) wrote:
>
> Current D botches quite a few of the arithmetic conversions. Basically
> all conversions that may lose value, meaning, or precision should not be
> allowed implicitly.
Exactly.
> Walter is willing to fix D in accordance to that
> rule, which would yield an implicit conversion graph as shown in:
>
> http://erdani.org/d-implicit-conversions.pdf
>
> Notice that there is no arrow e.g. between int and uint (loss of
> meaning), or between int and float (loss of precision). But there is an
> arrow from int and uint to double, because double is able to represent
> them faithfully.
>
> If we are nice, we may convince Walter to implement that soon (maybe in
> 1.006?) but it must be understood that the tighter rules will prompt
> changes in existing code.
That's fine with me. Many of us have been asking for this for quite a
while.
Sean
More information about the Digitalmars-d
mailing list