Re: space effecient representations of list subsets (addendum)

Jaap Vermeulen (jaap@sequent.com)
Fri, 03 Dec 93 13:42:00 PST

| I.e., the (exact) same objects appear in each list: only pointers have
| been copied. I believe the semantics of the language _require_ the
| implementation to copy just a reference (pointer) for mutable objects,
| but allow reference or value copying for immutable objects (but that the
| current implementation usually (always?) just copies a pointer even then
| -- and that that's unlikely to change in future implementations).

I fail to see why copying mutable or immutable objects would make a
difference in whether you would use shallow (reference) or deep (value)
copy. And logic would actually demand the opposite as what you claim; since
immutable objects don't change why copy the value? In python (and Smalltalk
for that matter) all copies are shallow. The difference between python and
smalltalk is that smalltalk treats constants (such as numbers) as special
that always return the same id, no matter where and how often you use
(instantiate) it.

$0.02

-Jaap-