3 ms·
No offense but that's a wrong take on sum types. Sum types should be baked in the same way basic POD structs are, they're that fundamental. That D still doesn't
by c-cube 4y ago
No offense but that's a wrong take on sum types. Sum types should be baked in the same way basic POD structs are, they're that fundamental. That D still doesn't have them as a core construct (along with pattern matching as the core mechanism to inspect the values) is, to me, a weakness inherited from C++ and other 1990s OO-driven languages, and patched in the same insufficient way (see std::variant).
- germandiago 4y agoIt is a nice-to-have feature. But languages like Python and C#, Java and many others have survived without it. C++ has std::variant. Not that ergonomic but usable enough if you wrap it a bit for your own use cases.