In article <5k67a4$nit@mulga.cs.mu.OZ.AU>,
Andrew Bromage <bromage@cs.mu.OZ.AU> wrote:
>
>doylep@ecf.toronto.edu (Patrick Doyle) writes:
>
>> Can you give an example of two immutable objects, alike in every way,
>>which need to be distinguished?
>
>They may need to be distinguished for the purpose of compile-time
>garbage collection. If you create two immutable identical objects,
>it may be easier to discover when they become garbage because the
>references to them are unique, than if they were one object with
>a shared reference.
>
>Admittedly the programmer does not necessarily need to see this.
Neither does the GC. It can simply throw away one of the objects
immediately and use the other, can't it?
-PD
--
--
Patrick Doyle
doylep@ecf.utoronto.ca
|