`alias x = v.x;` not working in struct bodies?

Danilo codedan at aol.com
Sat Jan 20 22:39:05 UTC 2024


On Saturday, 20 January 2024 at 22:25:35 UTC, Danilo wrote:
> If you step back to see the bigger picture, it is very 
> intuitive to write:
> ```d
> alias x = v.x;
> alias y = this.v.y;
> ```
> It means giving an `alias name` to an entity, and I think it's 
> not hard to understand that.
> It's just logical in a broader sense, when you look at the 
> bigger picture. ;)

`alias` is already reserved for special purposes in D, so we 
probably
need a new keyword for this: `pseudonym`
```d
pseudonym x = v.x;
pseudonym y = this.v.y;
```

Don't take that too seriously, just came to my mind... lol ;)


More information about the Digitalmars-d mailing list