Enum helper package?

I like the case based thing, because it gives a compile time error if all types aren’t accounted for - like if you add a new Fruit later, or remove one. For the same reason I’m more in favor or strings rather than index numbers for encoding, because its more future proof.

One thing that might be handy would be a function to make a list of all the enums. There was a thread about this a while back. A function nextType could be used to recurse through all the types, and give a compile error if a case is missing, or a type was deleted.

3 Likes