Helping with __mutable (which will be renamed to __metadata)

Timon Gehr timon.gehr at gmx.ch
Mon Apr 15 15:59:35 UTC 2019


On 15.04.19 17:08, Suleyman wrote:
> On Monday, 15 April 2019 at 11:17:55 UTC, Timon Gehr wrote:
>> On 14.04.19 22:55, Suleyman wrote:
>>> ...
>>
>> No, the point is that whatever high-level rewrites you can deduce from 
>> `immutable` and `pure` shouldn't be restricted by code that modifies 
>> `__metadata`.
>>
>> ...
> 
> Just making it @system is not helping much instead of evading reality 
> you rather treat as it really is an immutable ref with mutable fields 
> hence the compiler must not elide function calls with these weakly 
> immutable arguments.
> 

At that point, why do you need to slap `immutable` on your type in the 
first place? Why does your proposed semantics make any sense for 
reference counting or caching/lazy evaluation?


More information about the Digitalmars-d mailing list