Re: [go-nuts] [generics] generic function definition all in one parameter list

2020-07-21 Thread Tor Langballe
For constraints they also could be after type name: func IndexOf(slice []type T comparable, find T) int or maybe this is clearer: func IndexOf(slice []type comparable T, find T) int This generic type information could be added on leftmost first use of the type in the parameter list or return, an

Re: [go-nuts] [generics] generic function definition all in one parameter list

2020-07-21 Thread Ian Lance Taylor
On Tue, Jul 21, 2020 at 3:37 PM Tor Langballe wrote: > > This might have been discussed, but can't find anything about so easy, joined > late... > > Could generic function definitions be done all in one paramter list using the > type keyword? > > func IndexOf(slice []type T, find type T) int > >

[go-nuts] [generics] generic function definition all in one parameter list

2020-07-21 Thread Tor Langballe
This might have been discussed, but can't find anything about so easy, joined late... Could generic function definitions be done all in one paramter list using the type keyword? func IndexOf(slice []type T, find type T) int or func IndexOf(slice []type T, find T) int instead of func IndexO