Hi Dave,
The way I understand reduce is, if you have something like a
List[Int], you can reduce to a value of type Int, but you cannot go
from List[Int] and reduce it to a String, as in:
scala> List(1, 2, 3).reduce(_ + " " + _)
<console>:8: error: type mismatch;
found : java.lang.String
required: Int
List(1, 2, 3).reduce(_ + " " + _)
^
scala> List(1, 2, 3).reduce(_ + _)
res1: Int = 6
scala>
so, for your case, you have a List[Tuple2[String]] and you want to
reduce them to a JObject, but reduce doesn't let you do that. Does
that clarify things?
("a" -> "2") ~ ("a" -> "2") works fine because we are not
restricted to how reduce works.
Diego