The NaN of types (in D)

Imperatorn johan_forsberg_86 at hotmail.com
Sun Oct 11 17:07:11 UTC 2020


On Sunday, 11 October 2020 at 15:23:45 UTC, Stefan Koch wrote:
> On Sunday, 11 October 2020 at 15:19:17 UTC, Paul Backus wrote:
>> On Sunday, 11 October 2020 at 12:18:59 UTC, Stefan Koch wrote:
>>> [...]
>>
>> To me, this sounds more like an empty Optional!__type or a 
>> null __type* than a NaN. Maybe it would be better to leave 
>> __type as the non-nullable version, and use something like 
>> __type* to represent a type that may be absent.
>
> __type need an init value otherwise phobos breaks all over the 
> place.
> and it's much nicer if that value is not part of the domain.
> you can compare it 0.
> You can do calculations without 0 but it gets very complicated 
> very fast.
> The empty type is awesome! I love it!
> It allows me to simplify proofs so much.

Or have NaT = Not a Type, as NaN


More information about the Digitalmars-d mailing list