(non)nullable types

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Feb 17 20:05:04 PST 2009


On Tue, Feb 17, 2009 at 10:36 PM, Michel Fortin
<michel.fortin at michelf.com> wrote:
> On 2009-02-17 18:17:55 -0500, Christopher Wright <dhasenan at gmail.com> said:
>
>> One possible change: implicit casting with an assertion that the nullable
>> value is not null. I'm not sure whether this is a good idea. On the one
>> hand, it's easier for the programmer to use nullable types in that case; on
>> the other, it encourages people not to have error handling.
>
> I think it's a good idea: good enough to be useful, simple enough to be
> implemented without much hassle. Once we have enough code using
> non-nullable, it'll be easier to evaluate the impacts of adding compile-time
> constrains for nullables, and whether it's worth it or not.
>
> I wouldn't make it just like an assertion though. I'd make it something
> separate you can deactiave with a compiler switch, just like bound checking.

Actually each little debug check has a separate internal flag in the
compiler.  It just doesn't expose them all at that level of
granularity.  It just lets you turn them all on or all off.  :P



More information about the Digitalmars-d mailing list