4 ms·
Macros are not an alternative to generics, they're an alternative to C++'s template specialisation. Most languages with generics don't provide for user-control
by masklinn 12y ago
Macros are not an alternative to generics, they're an alternative to C++'s template specialisation.
Most languages with generics don't provide for user-controlled code generation via generics (if they do generics-based codegen at all, IIRC GHC uses erased generics for instance). They tend to use macro systems or preprocessors instead.
- pjmlp 12y agoI know, but they surely would be a better solution than "go generate", as I doubt Go will ever have generics.