5 ms·
> Rust has sum types, implemented as Enums Do you mean implemented with enums? Enums themselves are not a type. They are a mechanism for value generation, prov
by randomdata 2y ago
> Rust has sum types, implemented as Enums
Do you mean implemented with enums? Enums themselves are not a type. They are a mechanism for value generation, providing automatic numbering (hence enumeration) for constants. Indeed, they, like all values, are ultimately represented by a type, but that type can range from something like a simple integer or something more complex like a tagged union (typically with the generated value being the tag) with different ecosystems favouring different type approaches.
- tubthumper8 2y agoI think they just mean that sum types are defined by the programmer using the `enum` keyword
- randomdata 2y agoLike how subroutines are implemented as Functions. And by Functions you don't mean functions, but rather the letters fn? That is certainly an interesting way to communicate.