commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Bollinger <thinma...@yahoo.com>
Subject Re: [math] Mutable "Vector3D"
Date Fri, 24 Apr 2009 19:13:36 GMT
Ted Dunning wrote:
> On Fri, Apr 24, 2009 at 11:50 AM, John Bollinger <thinman42@yahoo.com>wrote:
>
> > Ted Dunning wrote:
> > > My view is that once it is immutable it is immutable.  Restoring
> > mutability
> > > is done by making a new copy [...].
> >
> > That position is stronger than you make it sound.  Changing a supposedly
> > immutable object so that it is mutable would itself be a mutation.  If it
> > were
> > possible then the object in question was never genuinely immutable in the
> > first place.
> >
> I agree, but that is a bit more of a philosophical answer.  I wanted to give
> an operational answer.

Yes and no.  I'm not trying to be nit picky, and I didn't explicitly say this in my
previous comment, but part of what I was thinking was that the sequence

foo.setMutable(true);
foo.setX(3.14159);

just as surely mutates "immutable" foo as it does mutable foo.


John



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message