[just talk] what if implicitly typed literals were disallowed

bearophile bearophileHUGS at lycos.com
Wed Oct 24 16:16:14 PDT 2012


Adam D. Ruppe:

> I was just focusing on complete customization there. But 
> another thing I'd like is for literals to be infinitely sized 
> until context forces it down.
>
> So if you were to write some enormous literal like 2^70 that 
> should work, then range checks say "hey too big" if you try to 
> assign it to a long or otherwise work on it.

This is how Go is designed, I think.

It also helps against this kind of bugs that are *not* acceptable 
in a language that defines itself as "safer than C":

http://d.puremagic.com/issues/show_bug.cgi?id=4835

Bye,
bearophile


More information about the Digitalmars-d mailing list