-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Document recent -dip1000 changes #2453
Conversation
Thanks for your pull request and interest in making D better, @thewilsonator! 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. |
This is great, but I think it needs to be more formally described in the spec: dlang/dmd#8346That PR causes the compiler to silently remove the Furthermore the dlang/dmd#8408I think this PR should be reverted, and we should come up with another way for the programmer to meta-programatically infer the storage classes. But, since that's unlikely, I'd like for the inference rules to documented in the spec. I'd also like for the spec to make it clear when inference takes place -- I think it only takes place for templates, not for ordinary functions or methods. That needs to clarified. Also, what is dlang/dmd#8504I think this requires mention in https://dlang.org/spec/function.html#return-ref-parameters. 1) The first parameter is special, iff it's You're not going to buy me off with a summary and a few paragraphs 😛. I think there's more to it than that. We also have to consider what this does to the DIP 1000 document. Personally, I think before any of these PR were/are merged there should be a PR to DIP1000 approving the design first. |
There's also a lot in https://wiki.dlang.org/DIP25 and https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md that should be folded into the spec with multiple examples illustrating the concepts. |
Another thing to consider is that a lot of these features are feature-gated behind |
I wasn't expecting to. This is also for me to understand the state of the implementation and verify that it is what I think it is, which is probably not true in the general case.
With dlang/dmd#8346 it's ignored if its not a pointer (incl. ref/out), so I think not?
No idea either. |
Thank you. But I still recommend moving anything related to DIP 25 and 1000 to a separate page until the design and implementation are finalized. |
@thewilsonator I've made some changes here to improve wording (and formatting). (Unfortunately github won't let me set your repo as the base for a PR for some reason). edit: See the full commit message for details. |
Thanks will merge them tomorrow. |
@ntrel Applied with some minor edits. |
Pinging @WalterBright again. |
@andralex can you review this? |
|
||
$(P The function parameter attributes $(D return) and $(D scope) are used to track what happens to low-level pointers | ||
passed to functions. Such pointers include: pointers, $(D this), classes, `ref` parameters, delegate/lazy parameters, | ||
and aggregates containing a pointer.) |
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.
Arrays? Or do you count those as aggregates?
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.
Suggest we use raw pointers, this, variables of reference type, ref/lazy parameters, ref return values and aggregates containing such pointers
.
c394642
to
fd37c5a
Compare
Pinging @WalterBright again: if you want me to be a functional PR manager, you need to review this. |
@thewilsonator Try emailing him directly if he is not responding. |
Woohoooo! Now I just need to figure out how to fix the LaTeX errors... |
2e1be40
to
4c330dc
Compare
4c330dc
to
47021d2
Compare
Hmm, can't tell if that actually improved things. I'm going to split this PR. |
Why don't you build it locally? |
spec/function.dd
Outdated
@@ -1241,8 +1241,13 @@ int foo(in int x, out int y, ref int z, int q); | |||
$(TROW $(D scope), references in the parameter | |||
cannot be escaped (e.g. assigned to a global variable). | |||
Ignored for parameters with no references) | |||
$(TROW $(D return), Parameter may be returned or copied to the first parameter, |
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 LaTeX errors are caused by the last comma in this line. The comma is interpreted by ddoc as a parameter separator, which in LaTeX is translated into an column separator (ampersand) because you're in a table. To fix, you may want to use $(TROW $(D return), $(ARGS Parameter may be returned...))
Made a commit directly in the interest of time. |
Thanks, I fixed some whitespace you left. Hopefully this works. |
IT WORKS!!! Thanks everyone! |
@tgehr I cannot see a rationale here for this change. |
Probably just an oversight. |
Document recent dip1000 related changes in:
dlang/dmd#8346
dlang/dmd#8408
dlang/dmd#8504
@WalterBright is this an accurate description?
cc @JinShil