Helping with __mutable (which will be renamed to __metadata)

Timon Gehr timon.gehr at gmx.ch
Sun Apr 14 00:38:16 UTC 2019


On 14.04.19 02:19, Suleyman wrote:
> On Saturday, 13 April 2019 at 08:58:06 UTC, Timon Gehr wrote:
>> Won't happen, because data with __metadata annotations inside will not 
>> be put in read-only memory. (This can be known statically.)
> 
> If it's adding these kinds of protections then I think it would be worth 
> it and a step forward in making D more safe. you might also consider the 
> 'shared' protection I mentioned earlier then maybe you can lift the 
> restriction on modification in @safe code.

I don't think it should be @safe. Rather, `pure` and `immutable` should 
retain their meanings, which implies that there are wrong ways to use 
`__mutable` (hence unsafe), and there are still non-cosmetic reasons to 
use `immutable` even if there are `__mutable` fields.


More information about the Digitalmars-d mailing list