binary dot assignment

Basile B. b2.temp at gmx.com
Mon Dec 30 21:33:58 UTC 2024


If you look long enough at some code you'll see patterns like

```d
a = a.b;
```

this pattern strangely looks like binary assignment operators

```d
a = a + b;
```

which can be rewritten as

```d
a += b;
```

In the same fashion we could have

```d
a .= b;
```

The point is to evaluate te left hand side only once.


More information about the dip.ideas mailing list