Persistent list

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 17 06:32:33 PST 2015


On 11/17/2015 04:47 AM, Marc Schütz wrote:
> Refcount also needs to change when you get an additional reference. But
> it is non-observable, because the caller can't access the refcount
> directly (or we could allow it, but as @system). The only potentially
> observable side-effect would be if the object is destroyed, but this
> only happens if there are no references left. Then the only way this can
> be achieved is if the destructor modifies state that is otherwise
> accessible (global, or by references), which however is not a problem,
> because the normal rules of const-ness apply to it.

I think it would be very difficult to prove at the type system level 
that the reference count is not observable. Humanly, sure, what you say 
makes sense. For a static checker, I don't think that's an approachable 
angle. -- Andrei



More information about the Digitalmars-d mailing list