Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread Victor Giordano
Thanks for sharing point the view!. And you can bet that i done that!!! :D It was quite a challenge you know!! In nowadays system is working, let keep crossing fingers please... El sáb., 26 ene. 2019 a las 18:45, robert engels () escribió: > Yes, and you can do that. > > On Jan 26, 2019, at 3:36

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread robert engels
Yes, and you can do that. > On Jan 26, 2019, at 3:36 PM, Victor Giordano wrote: > > Probably i need to reveal the underlying problem i was trying to solve > > At a glande: an appoinment subsystem for a health organization, considering > practitioners that work on services offering practices

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread Victor Giordano
Probably i need to reveal the underlying problem i was trying to solve At a glande: an appoinment subsystem for a health *organization*, considering practitioners that work on *services *offering *practices *that refers to *billables *items, the *practices *may need one or more *equipment*, also

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread Wagner Riffel
i don't quite understand why you're using enums as keys, you can use a anything but what already was pointed out, following your person example: https://play.golang.org/p/cuMlPeqR7Qb On Sat, Jan 26, 2019, 3:26 PM Victor Giordano wrote: > Yup! That's right! At the end of the day i used the

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread Victor Giordano
Yup! That's right! At the end of the day i used the enums idioms , employing integer type (the value that supports the "enum" ) (TL;DR;) Ancient History : The problem arises as i get used to use

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread mountainfpf
I looked at your program example, mainly using the reflection type to design the mapped key, perhaps the reflected key is a comparable type, but I mainly propose specific types, such as func, slice, map can not be used as a key use 在 2019年1月25日星期五 UTC+8下午11:31:57,Victor Giordano写道: > > Yeah, i

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-26 Thread mountainfpf
I use it often, I don't know what you mean by this. 在 2019年1月25日星期五 UTC+8下午11:04:08,Burak Serdar写道: > > On Fri, Jan 25, 2019 at 7:47 AM Victor Giordano > wrote: > > > > Just wanna say : It would be nice to employ a custom type as a valid key > for a map!!! :D > > You can use a struct as a

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-25 Thread Victor Giordano
Yeah, i got the idea. I had already researched about it and what you can do about it. I was only repeating what i want as a dev in this community! El viernes, 25 de enero de 2019, 12:04:38 (UTC-3), Wagner Riffel escribió: >

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-25 Thread Wagner Riffel
you can "employ" any custom type as key but the ones that doesn't defines equality operations, see https://golang.org/ref/spec#Comparison_operators as Ian already pointed out, you just can't build your custom type on top of func, map or slice to be a valid key, anything else you can. On Fri, Jan

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-25 Thread Burak Serdar
On Fri, Jan 25, 2019 at 7:47 AM Victor Giordano wrote: > > Just wanna say : It would be nice to employ a custom type as a valid key for > a map!!! :D You can use a struct as a key. > > > El jueves, 24 de enero de 2019, 0:47:32 (UTC-3), mount...@gmail.com escribió: >> >> thanks lan. >> >> 在

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-25 Thread Victor Giordano
Just wanna say : It would be nice to employ a custom type as a valid key for a map!!! :D El jueves, 24 de enero de 2019, 0:47:32 (UTC-3), mount...@gmail.com escribió: > > thanks lan. > > 在 2019年1月23日星期三 UTC+8下午11:26:57,Ian Lance Taylor写道: >> >> On Tue, Jan 22, 2019 at 11:47 PM wrote: >> >

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-23 Thread mountainfpf
thanks lan. 在 2019年1月23日星期三 UTC+8下午11:26:57,Ian Lance Taylor写道: > > On Tue, Jan 22, 2019 at 11:47 PM > > wrote: > > > > i got : > > # command-line-arguments > > ./key.go:6:18: invalid operation: F() == F() (func can only be compared > to nil) > > Yes, that is what the language spec says

Re: [go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-23 Thread Ian Lance Taylor
On Tue, Jan 22, 2019 at 11:47 PM wrote: > > i got : > # command-line-arguments > ./key.go:6:18: invalid operation: F() == F() (func can only be compared to > nil) Yes, that is what the language spec says and it is what I said: in Go, function values are not comparable. I wrote that code as

[go-nuts] Re: why map the key type must not be a function, map, or slice

2019-01-22 Thread mountainfpf
exec code: package main import "fmt" func main() { fmt.Println(F() == F()) } func F() func() int { i := 0 return func() int { i++ return i } } i got : # command-line-arguments ./key.go:6:18: invalid operation: F() == F() (func can only be compared to nil)