DIP 1017--Add Bottom Type--Final Review
Neia Neutuladh
neia at ikeran.org
Mon Jan 21 17:52:52 UTC 2019
On Mon, 21 Jan 2019 17:01:54 +0000, Olivier FAURE wrote:
> On Thursday, 17 January 2019 at 23:34:17 UTC, H. S. Teoh wrote:
>> At the very least, it would seem that the *name* of the type plays an
>> essential role in its identification. I.e., it's almost as if a struct
>> declaration is actually defining a type that, in addition to the types
>> of its fields, contains also an implicit string type identifying the
>> name of the struct. Or alternatively, we're dealing with a type system
>> where types are additionally decorated with string identifiers that
>> distinguish otherwise-identical types from each other.
>
> I wonder if there's a body of research in type theory about "decorated
> members" structural type systems; eg, where the name of an aggregate
> isn't part of its type, but the name of its members is.
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.
The more extreme variant, where everything is a tuple that implicitly
casts to any prefix of itself, is not very useful.
More information about the Digitalmars-d
mailing list