D grammar oddities

Dibyendu Majumdar mobile at majumdar.org.uk
Tue Nov 17 22:04:34 UTC 2020


On Tuesday, 17 November 2020 at 22:01:16 UTC, Dibyendu Majumdar 
wrote:
> On Tuesday, 17 November 2020 at 00:24:20 UTC, Paul Backus wrote:
>
>> A struct declaration *creates* a type, but it is not, itself, 
>> a type. When you declare `struct MyStruct { /* ... */ }`, the 
>> type that's created is just called `MyStruct`--which means 
>> that, grammatically, the type is an identifier.
>
> Sure - but the issue is the grammar is useless for trying to 
> understand the language.
>
> There is a production Types -> .... But it isn't map to a type.
>
> https://dlang.org/spec/grammar.html#types

wrong link - sorry - just look for Type production in the grammar


More information about the Digitalmars-d mailing list