Qualify C-style memory allocation functions as pure#1510
Open
nordlow wants to merge 1 commit intodlang:masterfrom
Open
Qualify C-style memory allocation functions as pure#1510nordlow wants to merge 1 commit intodlang:masterfrom
nordlow wants to merge 1 commit intodlang:masterfrom
Conversation
Update according to dlang/druntime#1683 I'm not sure if this is enough or if I should update the general formulation of purity aswell. Made an existing statement more clear via a neither-nor formulation.
UplinkCoder
reviewed
Dec 3, 2016
| $(H4 $(LNAME2 pure-functions, Pure Functions)) | ||
|
|
||
| $(P Pure functions are functions which cannot access global or static, mutable | ||
| $(P Pure functions are functions which cannot access neither global nor static mutable |
Contributor
Author
There was a problem hiding this comment.
Do you mean I should undo this fix?
Member
There was a problem hiding this comment.
No neither global nor static {,} mutable state
Member
There was a problem hiding this comment.
It doesn't work for it to be both cannot and neither. Either it's cannot with either and or, or it's can with neither and nor. You basically have a double negative if you have cannot with neither.
It was actually correct before, albeit a bit weird. It would probably flow better if mutable were put first, e.g.
cannot access mutable global or static state
or if you want to be really clear but somewhat awkward
cannot access mutable global or mutable static state
But as it stands, the fix is just wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update according to dlang/druntime#1683
I'm not sure if this is enough or if I should update the general formulation of purity aswell.
Made an existing statement more clear via a neither-nor formulation.