News for hackers. Stuff that matters.
Re:Toward Go 1.3 by ansible on Tuesday February 11, 2014 @04:38PM (#7220639)
I do definitely want some kind of support for genetics in golang. I do understand and respect the difficulties the principal authors have with integrating it into the language as-is.

There's actually a sort of workaround that I kind of liked:

http://play.golang.org/p/LkVWkyph75

Discussion here:

https://groups.google.com/forum/#!topic/golang-nuts/UyKree3B...

The basic approach is to define most of your generic data structure to use interface {}, and then have type-specific get/put and maybe comparison. This then minimizes the boilerplate code needed while retaining type safety. Implementing the generic functions requires a little more care than usual. But I think it is one of the best approaches for the language currently.

There are no comments on this comment yet.