Second Draft: ref for Variable Declarations

Nicholas Wilson iamthewilsonator at hotmail.com
Fri May 3 04:19:21 UTC 2024


On Friday, 3 May 2024 at 03:43:39 UTC, Walter Bright wrote:
> https://github.com/WalterBright/documents/blob/01291980cbfd80b85575fc6f8ba44d0d433cd4f8/varRef.md
>
> This is pretty much done.

This DIP has an implementation, you should link to it.

Most of the `Rationale` section is exposition (describing 
existing behaviour), not rationale. The last line of the 
rationale is parenthetical to the abstract, not the rationale. 
The actual rationale (comments about the use of `ref` in 
`foreach`), should be written as stating the upside of the use of 
such `ref`s, not that no downsides exist. You should give 
examples as to times when you felt the feature should exist (or 
link to them elsewhere in the document) rather than assert they 
exist (with no evidence).

You should include a diff of the relevant parts of there grammar 
(where appropriate).

Your example that purports to show the utility of the new feature 
is already accomplishable by `alias`
```d
void pop87(int line, const(char)* file)
{
     alias g = global87;
     // ... use `g`
```
as noted by Rikki in the previous thread.



More information about the dip.development mailing list