Add predefined version identifier D_BoundsChecks#8532
Add predefined version identifier D_BoundsChecks#8532Geod24 wants to merge 1 commit intodlang:masterfrom
D_BoundsChecks#8532Conversation
Geod24
commented
Aug 2, 2018
|
Thanks for your pull request and interest in making D better, @Geod24! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#8532" |
|
|
||
| One stylistic rule of D is that version identifier should be positive. | ||
| `D_NoBoundsChecks` stands out as an exception in this regard. | ||
| This version adds the opposite `D_BoundsChecks` so that code have at least |
There was a problem hiding this comment.
I think we might be subject to the deprecation policy being proposed at https://github.com/dlang/DIPs/blob/master/DIPs/DIP1013.md
src/dmd/mars.d
Outdated
| VersionCondition.addPredefinedGlobalIdent("assert"); | ||
| if (global.params.useArrayBounds == CHECKENABLE.off) | ||
| VersionCondition.addPredefinedGlobalIdent("D_NoBoundsChecks"); | ||
| else // Introduced in 2.082.0 - Deprecate `D_NoBoundsChecks` later |
There was a problem hiding this comment.
Use the deprecation comment syntax proposed in https://github.com/dlang/DIPs/blob/master/DIPs/DIP1013.md for easy grepping, and remain consistence with other deprecations in the code base.
|
Fine with me after we have a spec update and we get deprecation policy sorted out. |
WalterBright
left a comment
There was a problem hiding this comment.
It's not "strictly" enforced, just a strong bias that direction. Also, it should be removed from the documentation (and this added).
|
@JinShil : Thanks for the link, didn't knew about it. |
As explained in dlang/dmd#8532 the prefered style is positive version identifiers. The DMD PR adds the new version identifier to be used for at least a release before D_NoBoundsChecks is deprecated. In the meantime, it can already be undocumented.
|
Also found https://issues.dlang.org/show_bug.cgi?id=19137 out |
|
|
||
| One stylistic rule of D is that version identifier should be positive. | ||
| `D_NoBoundsChecks` stands out as an exception in this regard. | ||
| This version adds the opposite `D_BoundsChecks` so that code have at least |
There was a problem hiding this comment.
I think it should be either code bases or projects (code can't transition itself, can it?)
Good catch. I withdraw my approval until this is sorted out. |
WalterBright
left a comment
There was a problem hiding this comment.
Need to resolve bug 19137
|
@WalterBright : Could you give your opinion on said bug ? My original thought was that we could apply On the other hand @JinShil proposed to introduce Do you have an alternative idea, or do you prefer one of those ? |
One stylistic rule that is strictly enforced in D is that version identifier and CLI switch should be positive. `D_NoBoundsChecks` stands out as an exception in this regard. This PR just adds `D_BoundsChecks` so that code have at least one release to transition to it, before `D_NoBoundsChecks` is deprecated.
As explained in dlang/dmd#8532 the prefered style is positive version identifiers. The DMD PR adds the new version identifier to be used for at least a release before D_NoBoundsChecks is deprecated. In the meantime, it can already be undocumented.
ghost
left a comment
There was a problem hiding this comment.
This not worth starting a deprecation. New version identifiers however should follow the rule of being "positive". Also even if unlikey, the new reserved version could exist somewhere in some code, so a deprecation would also be required, making this (even if simple) change a long process.
I suggest @Geod24 to close.
|
Yes the benefit of this is very low, hence why I haven't pursued it. However, one note: version identifiers starting with |
|
ok, note taked. |