Second Draft: Turn properties into first class accessors

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Feb 6 00:52:55 UTC 2025


There is a guarantee that I want for this.

The compiler will guarantee that for every assignment that has a paired 
read, that there will be no other reads.

```d
@property {
     int value();
     void value(int);
}
```

```d
value += 2 + value;
```

Would be:

```d
{
     int __generatedName = value;
     value(__generatedName + 2 + __generatedName);
}
```

Not:

```d
value(value + 2 + value);
```

Furthermore, the loaded value must not escape the load statement.

This may seem unnecessary, but without this, I cannot think of a way for 
escape analysis to work with it.

With these guarantees, we might be able to special case it just enough 
for it to be modelable.



More information about the dip.development mailing list