-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
clarify what @property actually does #1141
Conversation
|
$(UL | ||
$(LI $(CODE @property) functions cannot be overloaded with non $(CODE @property) functions with the same name.) | ||
$(LI $(CODE @property) functions can only have zero, one or two parameters.) | ||
$(LI $(CODE @property) functions cannot have variadic parameters.) |
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.
The three points above are also mentioned later on, between the code samples. And it says "Properties may only have zero or one parameter" (not two) there.
You're right, I need to some more work here. |
thx for doing this! lmk when ready |
20f1b9f
to
490d3fd
Compare
I merged the two descriptions in property.html and function.html into one in function.html. Had to revamp the 'Optional Parentheses' section as well. Removed bogus examples. |
490d3fd
to
87e7783
Compare
@@ -123,7 +123,7 @@ $(H4 $(LNAME2 pure-functions, Pure Functions)) | |||
|
|||
$(P Pure functions are functions which cannot access global or static, mutable | |||
state save through their arguments. This can enable optimizations based on the fact | |||
that a pure function is guaranteed to mutate nothing which isn't passed to it, | |||
that a pure function is guaranteed to mutate nothing which is not passed to it, |
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.
The (previous) phrasing is quite awkward. Let's take this opportunity to change the text to:
This enables optimizations based on the fact that a pure function may at most mutate state reachable through its parameters.
lgtm after these nits |
87e7783
to
cd17dd4
Compare
clarify what @Property actually does
I gleaned these from reading the dmd source code. How they worked had changed around so much over the years, I did not know just how @Property interacted with UFCS. This clarifies it, or at least enumerates the effects.