|
|
|
|
|
by sgtcodfish
2848 days ago
|
|
There are proposals to add generics soon: https://go.googlesource.com/proposal/+/master/design/go2draf... It's not a question of whether or not it's easy or hard; it's definitely technically doable. It's a question whether or not it's desirable. I think the consensus is shifting decisively to saying that it _is_ desirable. The question then becomes how you can assert concepts on a type at compile time. E.g. for a function add(a T, b T) and a type T, how do we assert that a + b is a valid statement? The draft design shows one approach to this. |
|
And everyone not trying to make excuses for the Go-team knows what the one and only answer to that question is.