juan_gandhi: (VP)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2014-03-24 05:18 pm
Entry tags:

scala wtf

scala> val m = Map("a"->1, "b"->2, "c"->2)
m: scala.collection.immutable.Map[String,Int] = Map(a -> 1, b -> 2, c -> 2)

scala> val m1=m map {case (x,y) => (y,x)}
m1: scala.collection.immutable.Map[Int,String] = Map(1 -> a, 2 -> c)

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting