The NaN of types (in D)

Stefan Koch uplink.coder at googlemail.com
Sun Oct 11 19:45:06 UTC 2020


On Sunday, 11 October 2020 at 18:18:24 UTC, Paul Backus wrote:
> On Sunday, 11 October 2020 at 18:09:28 UTC, Stefan Koch wrote:
>>
>> Instantiating a template for just one more additional value?
>> Having to drag this bool around in ctfe?
>> Having to check it every time when you do an is-exp?
>>
>> that's crazy.
>> Especially when I have to choice to define an empty type.
>
> It doesn't have to be a template; it could be a __type*, or 
> something else built-in. The point is that code working with 
> __type variables shouldn't be *required* to add null checks 
> everywhere to account for the possibility of ø. Nullability 
> should be opt-in.

ø is a special case that shouldn't happen to often.

You are free to ignore the possibility of it being null.
Just like with classes which almost no one checks with class is 
null.



More information about the Digitalmars-d mailing list