On Monday, October 3, 2016 at 4:59:26 PM UTC+8, T L wrote: > > > > On Monday, October 3, 2016 at 2:42:30 PM UTC+8, Axel Wagner wrote: >> >> Which would imply that something like this >> type ( >> Foo int >> Foo int >> ) >> might be legal. I don't understand (and thusly disagree) why that would >> be in any sense "less confusing". >> > > > I confuse again. > > In your before comments, you interpretate "the same type-spec" must be > the only occurrence of a type-spec, and can't be two occurrences of same > type-spec > in texts. > But now you interpretate "the same type-decl" can be two occurrences of > same type-decl in texts. > > I really don't know my English understanding is right or not, now, again. >
Besides this, in fact, in the example you provide, https://play.golang.org/p/PmkcvdNQnx, there are two same (in texts) type declarations, they are both legal. And why does "the same type-decl" will imply "type (Foo int; Foo int)", but "the same type-spec" will not make the imply? > > > >> >> On Mon, Oct 3, 2016 at 7:26 AM, T L <tapi...@gmail.com> wrote: >> >>> >>> >>> On Monday, October 3, 2016 at 1:52:10 AM UTC+8, Marvin Renich wrote: >>>> >>>> * Matt Harden <matt....@gmail.com> [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...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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.