Second Draft: ref for Variable Declarations

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri May 3 04:31:48 UTC 2024


On 03/05/2024 4:19 PM, Nicholas Wilson wrote:
> Your example that purports to show the utility of the new feature is 
> already accomplishable by |alias|
> 
> |void pop87(int line, const(char)* file) { alias g = global87; // ... 
> use `g` |
> 
> as noted by Rikki in the previous thread.

I didn't know that it worked with same scope and was counter proposing 
expansion.

But yeah it totally does.

```d
import std;

int global;

void main()
{
     int var;
     alias g = global;
     alias v = var;

     writeln(g, v); // 00
}
```


More information about the dip.development mailing list