I’m fiddling around with enum and set. The attempt is to get a type checked
expression of what I mean… The enum items come from fields in a CSV file.
I have an enum defined as below. I will have more questions, but my first
question is how to write a set using my enum types as the basetype of the set.
Neither of the first BrokerBankLike statements will compile. (I can comment out
each one) They give Error: ordinal type expected.
type
MyBrokerTypes {.pure.} = enum
valSvcFee = “Service Fee”,
valWirFnd = “Wire Funds”,
valSell = “Sell”,
valBuy = “Buy”,
valCasDiv = “Cash Dividend”
BrokerBankLike = set[enum]
BrokerBankLike = set[MyBrokerTypes]
# The line below does compile, but it isn't what I want.
BrokerBankLike = set[char]
Run
Any suggestions on how I might do sets with enums ?