Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread T L
On Saturday, July 16, 2016 at 10:13:51 PM UTC+8, adon...@google.com wrote: > > On Saturday, 16 July 2016 05:31:41 UTC-4, Jan Mercl wrote: >> >> On Sat, Jul 16, 2016 at 10:39 AM T L wrote: >> >> > I know this result, but I just need the reason, not the result. >> >> The method set distinction of

Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread adonovan via golang-nuts
On Saturday, 16 July 2016 05:31:41 UTC-4, Jan Mercl wrote: > > On Sat, Jul 16, 2016 at 10:39 AM T L > > wrote: > > > I know this result, but I just need the reason, not the result. > > The method set distinction of T vs *T allows to forbid calling methods > intended to mutate the receiver (ie. re

Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread Jan Mercl
On Sat, Jul 16, 2016 at 10:39 AM T L wrote: > I know this result, but I just need the reason, not the result. The method set distinction of T vs *T allows to forbid calling methods intended to mutate the receiver (ie. receiver is *T) on the wrong receiver type (T). The later case would mutate th

Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread T L
On Saturday, July 16, 2016 at 4:20:36 PM UTC+8, Jan Mercl wrote: > > > On Sat, Jul 16, 2016 at 9:42 AM T L > > wrote: > > > is there any logic here? Or just a hard rule? > > https://play.golang.org/p/4YVDq2XLln > I know this result, but I just need the reason, not the result. > > > > -- > >

Re: [go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread Jan Mercl
On Sat, Jul 16, 2016 at 9:42 AM T L wrote: > is there any logic here? Or just a hard rule? https://play.golang.org/p/4YVDq2XLln -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] why the method set of *T is the superset of the method of T even if values of both *T and T can call both methods of *T and T?

2016-07-16 Thread T L
is there any logic here? Or just a hard rule? -- 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 ht