-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Enum Parameters #232
base: master
Are you sure you want to change the base?
Enum Parameters #232
Conversation
@Bolpat Thanks for submitting this, but next time please wait until your first draft is complete before submitting the PR. I'd rather keep in-development DIPs out of the queue. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this DIP interesting. It has fairly high potential for design problems that are hard to foresee, since many expressions that are currently always runtime can become compile-time. But it also enables so much new patterns that I think this is worth exploring further.
However, I'm less convinced about the @nodbi attribute. It solves a problem that can be mostly solvedl by simply assigning an enum
parameter to a local variable in the function. I do get the attribute has some advantages over that, but enum
arguments are already an advanced language feature that is at the limits of what most people can reasonably comprehend. Having an attribute that adds more rules on top of that probably isn't worth it.
@dukc, thank you for reading.
I thought that as well. I put it in because it can easily be removed later and one of the first reactions I got when I put the idea on the forum was: “But what about (template) bloat?” Had I found a workaround to get the benefits it provides, it’d never seen the light of day. I’ve marked it optional for now and I’m currently considering alternative syntax like Another rationale for talking about |
I'm all for this idea, sans the FWIW, a similar discussion on the forums brought this idea to the forefront: https://forum.dlang.org/post/unseru$167e$1@digitalmars.com So glad to see this all fleshed out and ready to go! |
No description provided.