The NaN of types (in D)

Stefan Koch uplink.coder at googlemail.com
Sun Oct 11 23:08:55 UTC 2020


On Sunday, 11 October 2020 at 20:37:56 UTC, Paul Backus wrote:
> On Sunday, 11 October 2020 at 19:45:06 UTC, Stefan Koch wrote:
>>
>> ø 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.
>
> Given that null references for classes are widely considered a 
> "billion dollar mistake" [1], the comparison does not exactly 
> fill me with confidence.
>
> Is there a serious problem with using __type* when you need 
> something nullable, and __type otherwise? It seems like the 
> best of both worlds to me.
>
> [1] 
> https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/

I am going to give this talk a listen.

__type can always be invalid, getting the super type of "object" 
or "int" for example would yield a type which is not a type.
I could have them return __type* .... I need to experiment with 
this.


More information about the Digitalmars-d mailing list