Re: [go-nuts] [generics] some questions

2020-06-18 Thread T L
On Thursday, June 18, 2020 at 8:01:22 AM UTC-4, Axel Wagner wrote: > > > > On Thu, Jun 18, 2020, 13:21 T L > wrote: > >> >> >> On Thursday, June 18, 2020 at 5:53:28 AM UTC-4, Axel Wagner wrote: >>> >>> >>> >>> On Thu, Jun 18, 2020, 11:28 T L wrote: >>> How to declare a generic functions whi

Re: [go-nuts] [generics] some questions

2020-06-18 Thread T L
On Thursday, June 18, 2020 at 8:01:22 AM UTC-4, Axel Wagner wrote: > > > > On Thu, Jun 18, 2020, 13:21 T L > wrote: > >> >> >> On Thursday, June 18, 2020 at 5:53:28 AM UTC-4, Axel Wagner wrote: >>> >>> >>> >>> On Thu, Jun 18, 2020, 11:28 T L wrote: >>> How to declare a generic functions whi

Re: [go-nuts] [generics] some questions

2020-06-18 Thread 'Bryan C. Mills' via golang-nuts
On Thursday, June 18, 2020 at 7:20:38 AM UTC-4 tapi...@gmail.com wrote: > On Thursday, June 18, 2020 at 5:53:28 AM UTC-4, Axel Wagner wrote: >> >> On Thu, Jun 18, 2020, 11:28 T L wrote: >> >>> How to declare a generic functions which converting a slice with type Ta >>> to a slice with type Tb. L

Re: [go-nuts] [generics] some questions

2020-06-18 Thread 'Axel Wagner' via golang-nuts
On Thu, Jun 18, 2020, 13:21 T L wrote: > > > On Thursday, June 18, 2020 at 5:53:28 AM UTC-4, Axel Wagner wrote: >> >> >> >> On Thu, Jun 18, 2020, 11:28 T L wrote: >> >>> How to declare a generic functions which converting a slice with type Ta >>> to a slice with type Tb. Like >>> func ConvertSli

Re: [go-nuts] [generics] some questions

2020-06-18 Thread T L
On Thursday, June 18, 2020 at 5:53:28 AM UTC-4, Axel Wagner wrote: > > > > On Thu, Jun 18, 2020, 11:28 T L > wrote: > >> How to declare a generic functions which converting a slice with type Ta >> to a slice with type Tb. Like >> func ConvertSlice(type Ta, Tb constraint)(ins []Ta) []Tb {...} >>

Re: [go-nuts] [generics] some questions

2020-06-18 Thread 'Axel Wagner' via golang-nuts
On Thu, Jun 18, 2020, 11:28 T L wrote: > How to declare a generic functions which converting a slice with type Ta > to a slice with type Tb. Like > func ConvertSlice(type Ta, Tb constraint)(ins []Ta) []Tb {...} > > How to constraint a type parameter must be of an interface type? > I don't think

[go-nuts] [generics] some questions

2020-06-18 Thread T L
How to declare a generic functions which converting a slice with type Ta to a slice with type Tb. Like func ConvertSlice(type Ta, Tb constraint)(ins []Ta) []Tb {...} How to constraint a type parameter must be of an interface type? Is it possible to define generic unnamed types? If it is impossi