2 ms·
> Rust's popularity is certainly helping that, though I wish they hadn't repurposed the existing word "enum" to serve as a new synonym for a concept with an exi
by cwzwarich 4y ago
> Rust's popularity is certainly helping that, though I wish they hadn't repurposed the existing word "enum" to serve as a new synonym for a concept with an existing name ("algebraic data types").
What keyword would you prefer they use instead, "datatype" like SML?
- kibwen 4y agoIf I were designing a language I'd call them or-types, to indicate a type that is "this OR that", as distinct from and-types, which are "this AND that". The product vs. sum terminology strikes me as needlessly forbidding, although it is undoubtedly cute that one can extrapolate algebraic data types to calculus and such.