Persistent list

Marc Schütz via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 17 10:06:05 PST 2015


On Tuesday, 17 November 2015 at 14:40:13 UTC, Dicebot wrote:
> On Tuesday, 17 November 2015 at 09:47:24 UTC, Marc Schütz wrote:
>> On Monday, 16 November 2015 at 16:58:24 UTC, Lionello Lunesu
>>> If it's RC we want, then @mutable is an axe when what we need 
>>> is a scalpel.
>>
>> It has additional uses, though, e.g. memoizing and  lazy 
>> initialization of members.
>
> Hiding memoization behind fake const is one of more unpleasant 
> C++ multi-threading abominations I have encountered during my 
> C++ says. Resulting races are so subtle (because only happen 
> once) and so inevitable (because it is subconsciously reasoned 
> about as physical const) that debugging them becomes real pain.
>
> This thread is really scary because of that. It is pretty much 
> saying that D attempt to rethink multi-threading data model 
> that caused trouble in C++ has failed completely and we back to 
> square one. Even if it isn't technical disaster, it is 
> marketing one for sure.

I don't think this is a concern for D, because we still have 
thread-awareness in the type system. We can distinguish between 
`@mutable` and `shared @mutable`, just as we distinguish between 
`const` and `shared const`.


More information about the Digitalmars-d mailing list