[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: the benefits of immutability
On 2003.08.30 16:51 Vadim Nasardinov wrote:
> What kind of functional restrictions do you have in mind? The classes
> used earlier in this thread -- Circle and ColoredCircle -- are
> immutable, for some fairly reasonable definition of "immutable". All
> of their methods are side-effect free (or can be made side-effect free
> without any bearing on the equivalence problem).
Yes, you're right about Circle and ColoredCircle -- but with these
examples can you show the kind of broken behavior illustrated by
InstrumentedHashSet? As it stands, they show a problem with cross-type
comparisons, which I agree is not solved by simply making the objects
immutable.
Michael