[cap-talk] 'Destroy' vs 'Sever'

David Hopwood david.hopwood at industrial-designers.co.uk
Tue Nov 27 15:09:06 EST 2007


Jonathan S. Shapiro wrote:
> On Mon, 2007-11-26 at 21:11 -0800, Charles Landau wrote:
> 
>> I repeat, Sever is not an operation on the object.
> 
> But aside from implementation convenience, it is not clear why this
> should be so. If I allocated an object, I can accomplish the effect of
> sever via:
> 
>   new alloc
>   shallow copy
>   destroy old

Except that in a pure object system there is not, and should not be, a
shallow copy operation that works on an arbitrary object (as opposed to
the object being able to shallow copy itself). Such an operation would
break encapsulation, and create undesirable aliasing of references to
objects that the copied object points to.

(Note that having allocated an object does not imply being able to access
its representation.)

-- 
David Hopwood


More information about the cap-talk mailing list