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

enums stops being enums #104

Open
Sairony opened this issue Oct 7, 2021 · 1 comment
Open

enums stops being enums #104

Sairony opened this issue Oct 7, 2021 · 1 comment

Comments

@Sairony
Copy link

Sairony commented Oct 7, 2021

There doesn't really seem to be much gained from wrapping everything in a class, but perhaps I'm missing something? For one it's not possible to forward declare the enum any longer since it's nested. If you try to retrofit it into an existing code base you run into a myriad of problems because suddenly your enums aren't really enums any longer. Enums are strongly typed from the get go, so it would seem most if not all the functionality could be had from generating function overloads anyway?

@aantron
Copy link
Owner

aantron commented Nov 8, 2021

Some of the trade-offs are listed in Should Better Enums provide enum "objects" or traits types? in the design decisions FAQ. There is also a link to an old implementation of Better Enums-as-language-enums. However, at the time I was publishing this repo, I chose not to go with the language-enums-plus-functions approach for the reasons described in the FAQ, and I haven't yet had the time and a strong enough reason to revisit that in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants