copy: self shallowCopy postCopy

stéphane ducasse ducasse at iam.unibe.ch
Tue Oct 18 21:07:18 UTC 2005


I was teaching today and showing to the students the difference of  
treatment
between squeak and vw for managing copy.

Squeak tries to have a smart generic way to copying objects and vw
does the inverse delegate as much as possible to the objects which is
much more oo and scalable (no deepInnerDeepDeepCopy).

So I was thinking that it may be good to think if we want to introduce
the same mechanism than in vw because it make a lot of sense to me.

Object>>copy
     self shallowCopy postCopy

Object>>postCopy
     ^ self
Object>>shallowCopy
     <prim>

then the classes can decide how they implement their own copy
overriding postCopy

So nice.
I will have to study carefully the one of Squeak but I guess that vw  
had the
same generic external approach and they realized it would not work in  
general
since each class can be willing to have another copy semantics.

Stef



More information about the Squeak-dev mailing list