Thanks for the explanation. On Tuesday, October 11, 2016 at 12:55:06 AM UTC+8, Ian Lance Taylor wrote: > > On Mon, Oct 10, 2016 at 9:51 AM, T L <tapi...@gmail.com <javascript:>> > wrote: > > > > On Tuesday, October 11, 2016 at 12:19:10 AM UTC+8, Ian Lance Taylor > wrote: > >> > >> On Mon, Oct 10, 2016 at 8:39 AM, T L <tapi...@gmail.com> wrote: > >> > In the section of go spec: > >> > https://golang.org/ref/spec#Uniqueness_of_identifiers, it says: > >> > > >> > Two identifiers are different if they are spelled differently, or if > >> > they > >> > appear in different packages and are not exported. Otherwise, they > are > >> > the > >> > same. > >> > > >> > So, two exported identifiers spelled same but in different packages > are > >> > the > >> > same identifiers? > >> > Is my understanding right? > >> > >> Yes. But don't confuse the fact that the identifiers are the same > >> with whether the objects that the identifiers denote are the same. > >> > >> The different handling of exported and unexported identifiers > >> particularly comes up with identifiers that denote struct fields or > >> methods, particularly when deciding how to handle embedded types and > >> promoted fields or methods. > >> > >> Ian > > > > > > So it is meaningless to prove two package-level identifiers, in two > > different packages, are the same? > > If you strictly mean package level, as in a const, func, type, or var > defined in the package block, then, yes, I think it is meaningless. > > Ian >
-- 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.