[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #35 from Jonathan M Davis --- (In reply to Sobirari Muhomori from comment #34) > https://github.com/D-Programming-Language/dmd/pull/4349 > The discussion was inconclusive? The change was reverted, though I don't know how conclusive the discussion that resulted was. Walter seemed to want to discuss it primarily so that we could close this as "won't fix" and move on (though I'm not sure that he was entirely against the idea), and Andrei definitely seemed to think that messing around with @ was a waste of time, but I don't think that it was ever definitively said what we'd do about it other than the fact that we'd revert the change until we were sure that we wanted to make it. Certainly, there was no consensus that this change should be made, and if anything, I think that the discussion leaned towards not making it, even aside from what Walter and Andrei thought, but I'd have to reread the thread to be sure of the details at this point. So, I'd say that this is almost certainly a "won't fix," but to be 100% sure, Walter or Andrei would have to say that that was the case. The discussion was here: http://forum.dlang.org/post/rtwbtxigfeupvykpb...@forum.dlang.org --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Sobirari Muhomori changed: What|Removed |Added Keywords||spec --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Sobirari Muhomori changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED |--- --- Comment #34 from Sobirari Muhomori --- https://github.com/D-Programming-Language/dmd/pull/4349 The discussion was inconclusive? --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #33 from Jonathan M Davis --- (In reply to Sobirari Muhomori from comment #32) > Automated migration from keyword syntax to attribute syntax can be done by > dfix. Then attribute syntax can be enforced if needed. I don't think that that's really the problem. The problem is that no proposal has been given which really makes the attribute names consistent in a way that makes sense to actually change to. We may agree that the status quo is ugly, but how things should be changed is not at all clear. So, we don't even know how we'd want to change the language to fix the attribute situation. And even if dfix makes it easy to change code, breaking code still causes problems. So, while dfix will definitely help reduce the pain when we do decide to make changes to the language which will require changing existing code, it doesn't make the language changes free. The fact that dfix could make it easy to change existing code does not mean that it's okay to make breaking changes without a very good reason behind them. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #32 from Sobirari Muhomori --- Automated migration from keyword syntax to attribute syntax can be done by dfix. Then attribute syntax can be enforced if needed. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Nick Treleaven changed: What|Removed |Added CC||ntrel-...@mybtinternet.com --- Comment #31 from Nick Treleaven --- (In reply to Jonathan M Davis from comment #28) > Regardless, I don't see any way that changing which attributes have @ on > them and which don't is going to make it consistent unless you put @ on all > of them, or you don't put it on any of them. The simplest consistent change would be to have built-in @attributes when they *only affect* functions, not variables. Then we don't need @const or @ref, as they can also affect variables/parameters. We would have @pure, @nothrow, @override, @abstract, @final ('@final class' only affects a class's methods, not variable members). 'return' would not be an attribute, as it can affect parameters. Using this guideline, we only have to change 5 attributes. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #30 from Ketmar Dark --- wow. so i was right. let's see how long it took for my other suggestions to become blessed. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 sinkuup...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC||sinkuup...@gmail.com Resolution|--- |FIXED --- Comment #29 from sinkuup...@gmail.com --- Closing because this PR was merged: accept @pure @nothrow @return attributes by Walter Bright https://github.com/D-Programming-Language/dmd/pull/4341 --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #28 from Jonathan M Davis --- (In reply to Don from comment #27) > >(In reply to Jonathan M Davis from comment #14) > >> I really think that we've passed the point where it's worth fixing it. > > NO This attitude is the biggest problem D has. > Please, watch Scott Meyer's talk again. "Most D code is yet to be written". > The future benefits of fixing this kind of crap, are huge. And this one > doesn't even break any existing code. > > Omitting the @ from pure and nothrow was heavily criticized at the time. It > was known to be a stupid decision. Two things have changed since then: > > (1) We now have UDAs. > (2) @property is gone. @property isn't gone. Kenji has been doing work on fixing it up, and in the end, we should end up in the situation where @property makes it so that parens are illegal, and parens are optional for non-@property functions with no arguments. Regardless, I don't see any way that changing which attributes have @ on them and which don't is going to make it consistent unless you put @ on all of them, or you don't put it on any of them. So, either we end up with safe, trusted, system, and property, or we end up with stuff like @public, @const, and @static - which would be hideous IMHO. So, it seems to me that no matter which way we go, we end up with something that's ugly in some way or another, so I see no reason to change it. We'd just be moving the ugliness and inconsistency around. As it is, a very small percentage of the attributes have @ on them, which I think is a good thing. I'd much rather leave @ for UDAs. Regardless, for anything like this to happen, you'd have to convince Walter, and this is exactly the sort of thing he's likely to say no to because it doesn't have any real practical, technical benefit. At best, it just makes it easier for newbies to figure out whether @ goes on the front of an attribute or not, and unless you put @ on _all_ of them, I don't think that it really even does that. So, you're going to have a very hard time convincing him. I expect that he'll see it as useless shuffling around that will break code for no real benefit. - Jonathan M Davis --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #27 from Don --- >(In reply to Jonathan M Davis from comment #14) >> I really think that we've passed the point where it's worth fixing it. NO This attitude is the biggest problem D has. Please, watch Scott Meyer's talk again. "Most D code is yet to be written". The future benefits of fixing this kind of crap, are huge. And this one doesn't even break any existing code. Omitting the @ from pure and nothrow was heavily criticized at the time. It was known to be a stupid decision. Two things have changed since then: (1) We now have UDAs. (2) @property is gone. Now, the existence of @property was the only decent argument against @pure, @nothrow. Nobody could come up with a simple rule as to why 'property' should be an attribute, because it did actually affect the semantics. And (1) means that there are more benefits to making pure and nothrow behave as any other property. If we allow this, then we can just say "for historical reasons, you can leave the @ off @pure and @nothrow". I think that's far easier to justify than the current situation. I'm fully in favour of this. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #26 from Ketmar Dark --- Created attachment 1403 --> https://issues.dlang.org/attachment.cgi?id=1403&action=edit testcase; must fail with "'mustf.foo' is not nothrow" and "function 'mustf.bar' is nothrow yet may throw" --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 --- Comment #25 from Ketmar Dark --- Created attachment 1402 --> https://issues.dlang.org/attachment.cgi?id=1402&action=edit testcase; must compile --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Ketmar Dark changed: What|Removed |Added Attachment #1400|0 |1 is obsolete|| --- Comment #24 from Ketmar Dark --- Created attachment 1401 --> https://issues.dlang.org/attachment.cgi?id=1401&action=edit allow UDA-like syntax for 'pure' and 'nothrow' to remember: don't attach patches without proper checking. attached correct patch this time. --
[Issue 13388] accept '@' before 'nothrow' and 'pure'
https://issues.dlang.org/show_bug.cgi?id=13388 Ketmar Dark changed: What|Removed |Added Summary|accept '@' before |accept '@' before 'nothrow' |'nothrow', 'pure', 'final', |and 'pure' |'abstract' and 'override' | --