[dmd-concurrency] draft 3

Michel Fortin michel.fortin at michelf.com
Tue Jan 12 13:04:04 PST 2010


Le 2010-01-11 à 17:22, Andrei Alexandrescu a écrit :

> You're dead on.
> 
> I'm thinking of solving that problem through two mechanisms:
> 
> a) A deepCopy protocol. deepCopy(value) will create a copy of value that shares absolutely nothing with the original value. The type system won't be able to always ensure that, so we'll need to rely on the user to implement it properly. With deepCopy in place, UniqueArray works great - all you have to do is return a deepCopy() of the requested element. That way the addresses of the elements or their fields etc. never escape.

At this point, we have uniqueCopy and deepCopy. Couldn't we get rid of .dup/.idup for consistency, using the "copy" instead of "dup", for consistency?


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-concurrency mailing list