4 ms·
IMHO if C had generics then so many problems could be fixed (e.g. you could easily have a struct Slice<T> for a fat pointer). Existential generics would even gi
by jasonhansel 7y ago
IMHO if C had generics then so many problems could be fixed (e.g. you could easily have a struct Slice<T> for a fat pointer). Existential generics would even give you OOP (and, in a roundabout way, closures) for free. Hmm...
- JoachimSchipper 7y agoC11 has _Generic.
- jasonhansel 7y ago_Generic is something of a misnomer; it's more like a special form of overloading than a general way of adding type parameters. C++ is a bit better with templates, but lacks type erasure (hence long compile times) and existential generics (so OOP isn't just syntactic sugar).
- bshanks 7y agoWhat are existential generics? I searched Google but couldn't find the meaning of the term.
- jasonhansel 7y agohttps://wiki.haskell.org/Existential_type#Dynamic_dispatch_mechanism_of_OOP https://wiki.haskell.org/Existential_type#Dynamic_dispatch_m...
- bshanks 7y agothanks!