Re: [go-nuts] [Generics] Constraints package name

2020-08-18 Thread Frederik Zipp
ma...@acln.ro schrieb am Montag, 27. Juli 2020 um 08:34:04 UTC+2: > The entire notion of the constraints package feels a little suspicious to > me. What if the comparable and ordered constraints were pre-declared in the > universe block, and the numeric constraint were named math.Numeric? > In

Re: [go-nuts] [Generics] Constraints package name

2020-07-27 Thread Andrei Tudor Călin
The entire notion of the constraints package feels a little suspicious to me. What if the comparable and ordered constraints were pre-declared in the universe block, and the numeric constraint were named math.Numeric? What other universal (or close to universal) constraints would belong in this

Re: [go-nuts] [Generics] Constraints package name

2020-07-26 Thread 'Axel Wagner' via golang-nuts
On Sun, Jul 26, 2020 at 1:05 PM wrote: > Also, the name "is" doesn't follow the usual naming style of Go packages. >> > > I'm not sure if there is a Go standard library package naming style other > than "relatively short name". > "relatively short name" is less consistently applied than "be

Re: [go-nuts] [Generics] Constraints package name

2020-07-26 Thread Robert Engels
I like ‘is’. Very readable and Go-like. > On Jul 26, 2020, at 6:05 AM, frederik.z...@gmail.com wrote: > >  >> On Sunday, July 26, 2020 at 12:46:38 PM UTC+2, Jesper Louis Andersen wrote: >> >> You can always solve that with a rename: >> >> import ( >> is "constraints" >> ) >> >> but you

Re: [go-nuts] [Generics] Constraints package name

2020-07-26 Thread frederik . zipp
On Sunday, July 26, 2020 at 12:46:38 PM UTC+2, Jesper Louis Andersen wrote: > > > You can always solve that with a rename: > > import ( > is "constraints" > ) > > but you run the risk of users not knowing what the "is" package is. > Of course, but like you said, "is" would be unfamiliar to most

Re: [go-nuts] [Generics] Constraints package name

2020-07-26 Thread Jesper Louis Andersen
On Sun, Jul 26, 2020 at 9:30 AM wrote: > The package name "constraints" is quite a mouthful to read: > > func Min[Elem constraints.Ordered](s []Elem) Elem {} > > Did you consider other package names like "is"? > > func Min[Elem is.Ordered](s []Elem) Elem {} > > You can always solve that with

[go-nuts] [Generics] Constraints package name

2020-07-26 Thread frederik . zipp
The package name "constraints" is quite a mouthful to read: func Min[Elem constraints.Ordered](s []Elem) Elem {} Did you consider other package names like "is"? func Min[Elem is.Ordered](s []Elem) Elem {} is.Ordered is.Integer is.Signed is.Unsigned -- You received this message because