Helping with __mutable (which will be renamed to __metadata)

Timon Gehr timon.gehr at gmx.ch
Sat Apr 13 08:58:06 UTC 2019


On 13.04.19 06:49, rikki cattermole wrote:
> On 13/04/2019 3:45 PM, Suleyman wrote:
>> On Saturday, 13 April 2019 at 01:17:55 UTC, rikki cattermole wrote:
>>> I'm concerned that it will be used as an escape from the type system 
>>> arbitrarily. Right now there is nothing to discourage the abuse of 
>>> this storage class.
>>>
>>> Is there something we can do to discourage abuse?
>>
>>  From skimping through the DIP it doesn't look too dangerous it seems 
>> like just a fancy 'shared' escape for immutable fields, the rest looks 
>> the same as casting immutable away in @system code.
> 
> What you described is a feature that escapes the type system which can 
> lead to program crashes. Read only memory is what I'm concerned about.

Won't happen, because data with __metadata annotations inside will not 
be put in read-only memory. (This can be known statically.)


More information about the Digitalmars-d mailing list