Why is there no mutable TreeMap in Scala?

soc picture soc · Dec 25, 2010 · Viewed 8.9k times · Source

Is it lack of time, some technical problem or is there a reason why it should not exist?

Answer

Rex Kerr picture Rex Kerr · Dec 26, 2010

It's just a missing case that will presumably eventually be filled in. There is no reason not to do it, and in certain cases it would be considerably faster than the immutable tree (since modifications require log(n) object creations with an immutable tree and only 1 with a mutable tree).


Edit: and in fact it was filled in in 2.12.

Mutable TreeMap.

(There is a corresponding Set also.)