Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



I think they just mean that sum types are defined by the programmer using the `enum` keyword


Like 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: