Re: [go-nuts] No Generics - Type Binding on Imports

2021-03-22 Thread Ian Lance Taylor
On Mon, Mar 22, 2021 at 2:10 AM Martin Leiser wrote: > > > What happens if > >I try to import a package that defines that Min function but I set the > >argument type to some that does not support the < operator? > I would simply write two similar packages: one using the above mentioned >

Re: [go-nuts] No Generics - Type Binding on Imports

2021-03-22 Thread Martin Leiser
Am 22.03.2021 um 10:10 schrieb Martin Leiser: Am 21. März 2021 22:01:38 MEZ schrieb Ian Lance Taylor : On Sun, Mar 21, 2021 at 1:02 PM Martin Leiser wrote: ... import "container/list" stringlist type ElementType = string What if I want to have a list of lists of strings? That is a

Re: [go-nuts] No Generics - Type Binding on Imports

2021-03-22 Thread Martin Leiser
Am 21. März 2021 22:01:38 MEZ schrieb Ian Lance Taylor : >On Sun, Mar 21, 2021 at 1:02 PM Martin Leiser >wrote: >> >> I think so. But How? Remember we need to do two things: >> >> - A way to define type parameters. >> >> - A way to bind the type parameters to concrete types at compile

Re: [go-nuts] No Generics - Type Binding on Imports

2021-03-21 Thread Ian Lance Taylor
On Sun, Mar 21, 2021 at 1:02 PM Martin Leiser wrote: > > I think so. But How? Remember we need to do two things: > > - A way to define type parameters. > > - A way to bind the type parameters to concrete types at compile time Thanks for the note. I think that a generics proposal needs