One distinction that might be helpful is the difference between people using a generic data structure and people writing a generic data structure. It's much more important that the code that makes use of generics be readable than it is that the body of the generic be readable; after all, the existing generic map implementation is a mashup of compiler and runtime stuff, and few people expect to be reading that.
This does require that people who use generic data structures don't feel a need to grovel around in the source code to figure out how it works. On Thursday, August 24, 2017 at 11:14:58 AM UTC-4, JuciĆ Andrade wrote: > > A lot of people like Go because code is very readable even for beginners. > > func f(x, y int) > > f is a function that receives x and y as int parameters, returning > nothing. Simple enough. > > func f(x, y int) int > > f is a function that receives x and y as int parameters, returning yet > another int. Fine. > > func f(x, y int) (z int, err error) > > f is a function that receives x and y as int parameters, returning two > values: a first int, that we name z and an error named err. A little bit > weird, but ok. > > func (r MyType) f(x, y int) (z int, err error) > > f is a method for a value of type MyType, henceforth named r, that > receives x and y as int parameters, returning two values: a first int, that > we name z and an error named err. Definitely not so simple. > > <genType1, genType2> func (r genType1) f(x, y genType2) (z getType2, err > error) > > You must be kidding. STOP RIGHT THERE! > > -- 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.