News for hackers. Stuff that matters.
Re:Algebraic Data Types for C99 by bunderbunder on Thursday May 09, 2024 @03:25PM (#40312028)
You've got to distinguish syntax from semantics, though. I agree, it's easy to turn a big semantic win into a net readability loss if you choose to represent it with an overly terse syntax that promotes code golf.
Re:Algebraic Data Types for C99 by ajross on Thursday May 09, 2024 @06:03PM (#40313394)
Compilers are really smart. It's easy enough in the modern world to demand that a "type" field be checked against all enumerants, preserving the "semantic win". A plain old C switch statement with gcc -Wall will do this today, in fact.