Re: copying objects
jon klein <[email protected]>
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
On Mar 3, 2004, at 10:14 AM, Eric DeWitt wrote: > Wouldn't you still have the shallow/deep copy problem? Undefined > behavior is bad. I'd much prefer that we be required to implement our > own methods, which could be passed to other methods (a la the sort for > lists) where appropriate. I believe it is only possible to have > defined copy behavior for shallow copy--I could be wrong. No -- the dependencies are designed to define exactly how a "deep" copy works. There's no reason not to have one method for "copy" and another for "deep-copy" (which would take dependencies into account). There would be no undefined behavior, though the user would have to be careful to setup the dependencies correctly. The dependencies are somewhat inspired by the Mac OS X AppKit archiving/dearchiving/copying techniques, which work very well, but are somewhat more complicated. You can look at AppKit documentation for more information on how these techniques work. - jon klein _______________________________________________ breve mailing list [email protected] http://www.spiderland.org/mailman/listinfo/breve