Re:Show HN: Sum (algebraic) types for C in one 100 line header
by Hirrolot on Tuesday May 28, 2024 @11:36AM
(#40501791)
I used to define `Maybe` in C as a macro over a tagged union. It really unveiled a number of logic errors at compile-time, but the issue of course is to use this kind of metaprogramming sanely. E.g., instantiating `Maybe` to some other macro `T(a)`, where `a` is some other (concrete) type, would already cause a headache.
[ Parent
| on HN ]
There are no comments on this comment yet.