[BUG][FIX] Very deep copy aid ([approved])

Doug Way dway at riskmetrics.com
Wed May 28 00:03:42 UTC 2003


[approved]


> Ted Kaehler wrote:
> 
> Object>>veryDeepCopyUsing: is a utility method.  When you have a
> complex data structure, involving several custom classes,
> veryDeepCopy on a subpart may not do what you want.  When you
> veryDeepCopy one of your objects, it does not know which instance
> variable are actually pointers back to a 'global' object, which
> should not be duplicated.  The 'parent' links in a tree are an
> example.  These can be handled by creating veryDeepInner: and
> veryDeepFixupWith:.  However, it may be easier to make a custom
> veryDeepCopy method.  In it, you create a DeepCopier, and store into
> its references dictionary with (globalObject -> globalObject).  Then
> you want to start a veryDeepCopy using that DeepCopier, and calling
> veryDeepCopyUsing: is the way to do that.
> 
> Change Set:             VeryDeepCopyU-tk
> Date:                   13 May 2003
> Author:                 Ted Kaehler
> 
> (Tested in a standard 3.6alpha)
> 
> 
> 
>                                Name: VeryDeepCopyU-tk.1.cs.gz
>    VeryDeepCopyU-tk.1.cs.gz    Type: Macintosh File
>                            Encoding: base64
> 
>    ATT2153808.txtName: ATT2153808.txt
>                  Type: Plain Text (text/plain)



More information about the Squeak-dev mailing list