The NaN of types (in D)
Stefan Koch
uplink.coder at googlemail.com
Sun Oct 11 13:11:28 UTC 2020
On Sunday, 11 October 2020 at 12:46:53 UTC, Imperatorn wrote:
> On Sunday, 11 October 2020 at 12:18:59 UTC, Stefan Koch wrote:
>> Good Morning,
>>
>> today I would like to write about something which came up
>> while implementing type functions.
>>
>> [...]
>
> Shouldn't this be the universe. The empty set is "there is no
> _", while the "opposite" ¬∅ of the empty set is the universe?
The universe would be __type. (because it can hold any type in U)
If you set the __type.init to be __type; (And that's how it used
to be)
The that means you cannot distinguish between a function
returning __type.
(Assuming your type function gives you the return type of a
function)
And the programmer having messed up the and forgot to set the
value.
Therefore you need an initial value which cannot possibly be a
valid type anywhere.
Hence a type which is no valid type is needed.
More information about the Digitalmars-d
mailing list