-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
DIP: Add throw as Function Attribute #167
Conversation
What about the inverse of |
This is important to consider. While I like |
@wilzbach I haven't decided how to do that. But with |
The DIP doesn't specify whether It also doesn't specify the grammar changes.
https://github.com/dlang/DIPs/blob/master/docs/guidelines-authors.md#technical-details |
I believe that this solution is the wrong way to go as it doesn't scale or integrate well with D's metaprogramming abilities. There's no way toggling an attribute on or off depending on a template parameter, short of using mixins or repeating the whole function definition. The right way to go is to add compiler recognized UDAs (like we already did for |
No need to, since it is a function attribute it is implicitly included.
The first sentence after "Description". |
It wasn't clear to me that that specifies the grammar change, since the DIP doesn't mention the word 'grammar' once, and it links to: Instead of: Also if I understand correctly, that change only allows Usually DIPs have an explicit section of grammar changes with a markdown diff of the grammar before and after the DIP. I suggesting doing this too.
A DIP should be explicit, such that (like Andrei put it) even a vengeful ex would implement it correctly. The DIP doesn't say it's a "function attribute", just that it's an attribute that only has an effect on functions. I don't think the spec defines what a "function attribute" is, the part about getFunctionAttribute mentions an explicit list of supported attributes, which (obviously) excludes It's unspecified whether void t0() nothrow; // tuple("nothrow", "@system")
void t1() throw; // tuple("throw", "@system")
void t2(); // tuple("@system") or tuple("throw", "@system")? |
02dc753
to
340cd2b
Compare
I added it to
Adding it to
The spec could certainly be improved, but that's a separate issue. |
No description provided.