Re: [go-nuts] Re: Update to generics proposal

2021-04-06 Thread yiyus
I was specifically talking about Ian's example, where no methods are defined. On Tuesday, 6 April 2021 at 15:57:18 UTC+2 Thomas Bushnell, BSG wrote: > On Mon, Apr 5, 2021 at 9:04 PM yiyus wrote: > >> > then I guess you mean that interface { MyInt } will accept any type >> > argument whose

Re: [go-nuts] Re: Update to generics proposal

2021-04-06 Thread 'Thomas Bushnell BSG' via golang-nuts
On Mon, Apr 5, 2021 at 9:04 PM yiyus wrote: > > then I guess you mean that interface { MyInt } will accept any type > > argument whose underlying type is the same as the underlying type of > > MyInt. But that seems strange. There is no connection between MyInt > > and MyInt2, except that they

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread yiyus
> then I guess you mean that interface { MyInt } will accept any type > argument whose underlying type is the same as the underlying type of > MyInt. But that seems strange. There is no connection between MyInt > and MyInt2, except that they happen to be defined in terms of the same > underlying

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread Ian Lance Taylor
On Mon, Apr 5, 2021 at 3:02 PM yiyus wrote: > > > More generally, if we omit approximation elements, it's a bit odd that > > if I write "int" I mean "an infinite set of types including int". It > > seems clearer to require people to explicitly indicate that they want > > to match the infinite

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread roger peppe
On Mon, 5 Apr 2021, 21:58 yiyus, wrote: > A type and its underlying type support exactly the same operations > FWIW I don't believe that's the case. A type may have methods (each with at least one corresponding operation) that its underlying type does not. -- You received this message

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread yiyus
> More generally, if we omit approximation elements, it's a bit odd that > if I write "int" I mean "an infinite set of types including int". It > seems clearer to require people to explicitly indicate that they want > to match the infinite set of types. What I propose is not that "int means an

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread Ian Lance Taylor
On Mon, Apr 5, 2021 at 1:58 PM yiyus wrote: > > I may have missed something, but I have problems to understand what is the > goal of the proposal. It says: > > > The purpose of introducing type lists in the generics proposal was to > > specify the operations available to type parameters in

Re: [go-nuts] Re: Update to generics proposal

2021-04-05 Thread yiyus
I may have missed something, but I have problems to understand what is the goal of the proposal. It says: > The purpose of introducing type lists in the generics proposal was to specify the operations available to type parameters in parameterized functions. I do not see how approximation

Re: [go-nuts] Re: Update to generics proposal

2021-04-04 Thread roger peppe
On Sun, 4 Apr 2021 at 00:48, Eltjon Metko wrote: > I was fully expecting for floodgates of comments to open again but it > seems we have reached a point of maturity in the generics proposal. > The new proposal really makes the intent much clearer both on the exact vs > underlying type match

[go-nuts] Re: Update to generics proposal

2021-04-03 Thread Eltjon Metko
I was fully expecting for floodgates of comments to open again but it seems we have reached a point of maturity in the generics proposal. The new proposal really makes the intent much clearer both on the exact vs underlying type match front and the syntax gives us a more familiar union