Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
SI-7445 ListMap.tail is returning wrong result #3388
You mean documenting the ordering properties of ListMap? We might as well document them since we have to guarantee them in any case.
It's a bit annoying that the behavior of ListSet and ListMap is so different, but I guess we can't change one to match the other.
Are documentation PRs still OK while in the RC phase of a release?
I came across this pull request while researching immutable ListMaps. I had been wondering whether the behavior I had presumed and have observed--that iteration order reflects insertion order--is guaranteed (Scala 2.9.2 output follows):
scala> import scala.collection.immutable._
scala> val map = ListMap("F" -> "Frank", "G" -> "George")
scala> val map2 = map + ("H" -> "Henry", "I" -> "Ida")
Based on Rüdiger's comment above, it sounds like that behavior is indeed guaranteed?
Yes, we have to guarantee the that iteration order reflects insertion
I am currently busy with the day job and the kids, but when I have some
By the way: it's a shame ListMap is called ListMap. If we would back it by
On Sat, Feb 8, 2014 at 4:34 AM, dmanchester email@example.com:
Great--thanks for confirming, Rüdiger.
Regarding the name, might there be support for adding an InsertionOrderedMap and InsertionOrderedSet (or something like that)? The map could take advantage of optimizations like the one you propose, and the set could address ListSet's unexpected ordering.