DIP 1017--Add Bottom Type--Final Review
Dukc
ajieskola at gmail.com
Wed Jan 16 09:43:24 UTC 2019
On Wednesday, 16 January 2019 at 08:47:48 UTC, Johannes Loher
wrote:
> On Tuesday, 15 January 2019 at 18:51:13 UTC, Johannes Loher
> wrote:
>> [...]
> 18.
>> A point was raised that Tbottom* == typeof(null) and Tbottom[]
>> == typeof([]) would be preferable to both cases equating to
>> Tbottom.
>
> What does `Tbottom*` mean conceptually? It is a type which can
> hold either an address where a `Tbottom` is located, or `null`.
> However, there cannot be any address where a `Tbottom` is
> located, because `Tbottom` does not have any values. This means
> that `Tbottom*` is a type which can hold exactly one value:
> `null`.
I think it was me who brought that pointer thing up in last
review. Nicholas Wilson lambasted my idea, and rightfully,
because I didn't come up with any practical use for null being
defined like that. Well, now I have one: It could be used to
finally let `null` to be assigned to `std.typecons.Nullable`.
> ```
> alias void = Tbottom*;
> ```
I believe you meant `enum null = typeof(Tbottom*).init;`
More information about the Digitalmars-d
mailing list