top | item 42484390

(no title)

hashmush | 1 year ago

I don't get it, why wouldn't you just store tag + count instead? Am I missing something?

discuss

order

nimih|1 year ago

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

3836293648|1 year ago

These 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

evertedsphere|1 year 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