Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring enumerations without ordinal #32

Open
istathar opened this issue May 10, 2020 · 0 comments
Open

Declaring enumerations without ordinal #32

istathar opened this issue May 10, 2020 · 0 comments
Labels
help-wanted Could use help from someone more knowledgeable than us

Comments

@istathar
Copy link
Member

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.

@istathar istathar added the help-wanted Could use help from someone more knowledgeable than us label May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted Could use help from someone more knowledgeable than us
Development

No branches or pull requests

1 participant