Bottom Type--Type Theory

Olivier FAURE couteaubleu at gmail.com
Thu Jan 17 18:38:54 UTC 2019


On Thursday, 17 January 2019 at 17:53:10 UTC, H. S. Teoh wrote:
> For one thing, Top would be the supertype of every other type, 
> so you could pass in values of any type to bar:
>
> 	bar(123);
> 	bar("abc");
> 	bar(null);
> 	bar(Unit.init);
>
> Which ultimately makes sense, because we could have gotten ptr 
> from taking the address of a float, for example, and it would 
> be UB to assign a string to *ptr.
>
> You could cast the Top* to something else, but that gets into 
> the realm of implementation-defined behaviour (it could be just 
> UB), and no longer something under the auspices of type theory.

All these sound like things that would make sense with void?

For instance, I think it would make sense to call a function `int 
foobar(void, void)` with as `foobar(1, "abd")`, which is 
basically the function saying it will ignore these parameters.


More information about the Digitalmars-d mailing list