I am using the ++: operator to get a collection of two collections, but the results I get using these two methods are inconsistent:
scala> var r = Array(1, 2)
r: Array[Int] = Array(1, 2)
scala> r ++:= Array(3)
scala> r
res28: Array[Int] = Array(3, 1, 2)
scala> Array(1, 2) ++: Array(3)
res29: Array[Int] = Array(1, 2, 3)
Why do the ++: and ++:= operators give different results?
This kind of difference does not appear with the ++ operator.
The version of Scala I am using is 2.11.8.