> > Well, in fact I would very much like to have immutable vectors too. > Immutability is really a way to simplify implementations. Surprisingly it > sometimes also decrease time and memory consumption, because defensive > copies littering user code can be avoided. > Luc, I have a silly question. Why do you think immutable vectors would prevent defensive copy ? Creating an immutable vector from an existing mutable vector would require a defensive copy, wouldn't it? Thats the reason why I'm talking about read-only vectors, and not immutable vectors. The solver would keep a reference to the underlying (mutable) vector, so would be able to modify (indirectly) the read-only vector. The observer would only have a reference to the read-only vector, so would not be able to modify the underlying vector.
Sébastien --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org