Thank you for the explanation. I am still curious, though, since it is not 
difficult to create a variant of the problem where one needs to actually keep a 
thing into two different collections. For instance, say I am designing a cache 
where I keep objects of type `ref T`. I want to be able to evict the cache 
smartly, so I keep two collections:

  * `accessTimes: Table[ref T, int]`, which keeps, for each object, the last 
time it was accessed
  * `frequencies: Table[ref T, int]` which keeps, for each object, the number 
of times it was accessed.



I can query these two structures to decide that some object is needed rarely, 
and not recently, hence I can free some associated resource, say close some 
files or handles.

The problem is again the same: how can I do that if only one of the collections 
can own `ref T`?

Reply via email to