4 ms·
I don't get it, why wouldn't you just store tag + count instead? Am I missing something?
by hashmush 2y ago
I don't get it, why wouldn't you just store tag + count instead? Am I missing something?
- evertedsphere 2y ago"enums" here are not like C enums, but rather tagged unions as in Rust where the individual items can store data rather than just being empty tags
- 3836293648 2y agoThese are enums as Rust coined the term, meaning sum types, not as C did, meaning a subrange of ints with magic names. The Spam and Eggs types contain data
- nimih 2y agoThe article is eliding the enum's payload. A more realistic example would, I think, have each leg of the enum contain a distinct type of struct (or some other data) in addition to the tag itself, and then have each EoA factored into its own internal SoA.