On Monday, October 3, 2016 at 1:52:10 AM UTC+8, Marvin Renich wrote:
>
> * Matt Harden <matt....@gmail.com <javascript:>> [161001 23:34]: 
> > I do think that T L has a point. The spec defines the syntax of the 
> > language, and TypeSpec refers to a syntactical construct. It is not 
> > possible in the syntax of the language to create two named types that 
> > originate in the same TypeSpec. We seem to be saying that uint8 and byte 
> > originate in the same "TypeSpec", but the "TypeSpec" referred to there 
> is 
> > an implementation detail of the compiler, not the syntactical construct 
> > defined in the Language Specification. 
>
> Does anyone remember if there was a time when TypeSpec was defined as 
>
>   TypeSpec = IdentifierList Type . 
>
> instead of the current 
>
>   TypeSpec = identifier Type . 
>
> This would give a clear reason why the wording under type identity is 
> the way it is.  I don't remember such a definition, and I've been 
> following Go since before Version 1, but not since the beginning, so 
> this is at least conceivable.  It's also possible that the Go authors 
> were considering such a definition, and part of the spec was written, 
> but the idea was thrown out as unnecessary and adding extra complexity, 
> accidentally leaving an artifact of a considered, but discarded, design 
> detail. 
>
> ...Marvin 
>
>
I just checked the history of go spec: 
https://github.com/golang/go/commits/master/doc/go_spec.html?after=mYQZV1%2BzTdUijP2zU6cxhOKduNorNTI0
It looks there is only one main change, from 

TypeDecl = "type" ( TypeSpec | "(" [ TypeSpecList ] ")" ) .
TypeSpecList = TypeSpec { ";" TypeSpec } [ ";" ] .
TypeSpec = identifier Type .

to

TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = identifier Type .

so go authors may really think "T0 and T0" is worth mentioning in go spec.

BTW, I think it would be less confusing if "originate in the same TypeSpec 
<https://golang.org/ref/spec#Type_declarations>" changed to "originate in 
the same TypeDecl". <https://golang.org/ref/spec#Type_declarations>



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to