Declaring enumerations without ordinal
istathar opened this issue · 0 comments
istathar commented
Right now we have this syntax for declaring enumerations, which is using a tablet to represent them and listing their ordinal values:
grades = [
"Principal" ~ 5
"Staff" ~ 4
"Senior" ~ 3
"Intermediate" ~ 2
"Associate" ~ 1
"Graduate" ~ 0
]
For things that are categorical, however, it would be nice to be able to use a list of labels:
disciplines = [
"Systems Engineer"
"Software Engineer"
"Data Engineer"
"Project Manager"
"Architect"
]
as there is no inherent ordering in this list. Internally we'd have to assign enum values, sure, but nice it the user didn't have to. (Longer term, perhaps if it's declared without ordinals then you wouldn't be able to treat it as if it had them. Someday when we have a real type system, maybe)
At the moment, however, the problem is Technique.Parser will fail parsing disciplines because of the lack of ~ binding characters.