DIP 1017--Add Bottom Type--Final Review

Olivier FAURE couteaubleu at gmail.com
Tue Jan 22 12:57:10 UTC 2019


On Monday, 21 January 2019 at 17:52:52 UTC, Neia Neutuladh wrote:
> That's what structural typing generally is. In essence, with 
> structural typing, everything is a NamedTuple that implicitly 
> casts to any projection of its fields.

I'm not sure. Most discussions I've seen equate structural typing 
with structures being tuples with no naming, and using field 
names to differentiate types with nominal typing.

I haven't seen much discussion of the difference between 
"structural with names" type systems (structs are NamedTuples) 
and "pure structural" type systems (structs are tuples).

> The more extreme variant, where everything is a tuple that 
> implicitly casts to any prefix of itself, is not very useful.

Why?

Everything you can do with nominal typing, you can do with named 
structural typing.


More information about the Digitalmars-d mailing list