On Thu, 2016-06-30 at 18:15 -0700, Chad wrote: > No, it's actually fine. You are comparing values.
The issue is that, yes while everything is a value, the value abstraction is tenuous in this context. The result of this tenuous abstraction is that there would be surprising behaviours (already outlined by others). > A slice being a struct under the hood, for slices you would compare > the structs (slice headers) > > For an interface, you compare two pointers (in the current > implementation) > > etc. > > "==" is just value comparison everywhere. > > Everything is a value. Some of the values are not specified in the language specification. Making this equality comparison possible for all types would require that these be specified, locking in the current implementation. This would be to get behaviour that is already available either by indirection or import of unsafe. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.