5 ms·
One really nice thing about object pascal(and nim I think) is that you can declare enums as array indexes. type TMonth = (mJan = 1, etc); TFooPerMon
by 1899-12-30 2y ago
One really nice thing about object pascal(and nim I think) is that you can declare enums as array indexes.
type
TMonth = (mJan = 1, etc);
TFooPerMonth = array[TMonth] of integer;
- psd1 2y agoThat is a great feature. You can have those semantics in .net, because any hashable can be a dictionary key. It will have a small performance penalty, which won't matter in 99% of cases. You could roll your own collection and get O(1). F# lets enum values be records, which is the most elegant solution IMO for manageable counts and fields.