August 11, 2018 Re: DIP 1017--Add Bottom Type--Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to docandrew | On Saturday, 11 August 2018 at 05:01:50 UTC, docandrew wrote:
> On Thursday, 9 August 2018 at 15:50:02 UTC, w0rp wrote:
>> A better name for this type is `never`, which is the name of the TypeScript type with similar semantics. https://www.typescriptlang.org/docs/handbook/basic-types.html#never `nothing` is also a decent name, used in some other languages, but `never` makes it more obvious that a function never returns, and isn't as easy to confuse with `void`, which is a different kind of nothing.
>
> +1 for "never" - it's descriptive and readable.
>
> -Jon
And brings us closer to Rust, which is a good thing.
But it does not matter, since the PR isn't suggesting any name for it -the user can create any alias of it he/she wants.
Personally, I think the most accurate term would be "Paradox" but again it does not matter for sake of this DIP.
|
August 11, 2018 Re: DIP 1017--Add Bottom Type--Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dukc | On Friday, 10 August 2018 at 13:15:46 UTC, Dukc wrote: > The benefit would be that null can be a regular pointer constant (enum null = typeof(&assert(false)).init) instead of a symbol with special meaning. I'd think it makes compiler rules less complex. I disagree. > Another advantage is that you could pass null as an argument for a function template which wants to know it's element type (but of course not instantiate it) like any other pointer. Of what _practical use_ is that? |
August 13, 2018 Re: DIP 1017--Add Bottom Type--Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | On Saturday, 11 August 2018 at 10:04:14 UTC, Nicholas Wilson wrote: > On Friday, 10 August 2018 at 13:15:46 UTC, Dukc wrote: >> The benefit would be that null can be a regular pointer constant (enum null = typeof(&assert(false)).init) instead of a symbol with special meaning. I'd think it makes compiler rules less complex. > > I disagree. I have no doubt you know more about compiler internals than me so not arguing about that. > >> Another advantage is that you could pass null as an argument for a function template which wants to know it's element type (but of course not instantiate it) like any other pointer. > > Of what _practical use_ is that? Tried to come up with an example but it would be so far-fetched that it won't be a reason in itself to add a new feature. I have to start to think longer before I post. |
Copyright © 1999-2021 by the D Language Foundation