scala wtf

Mar. 24th, 2014 05:18 pm
juan_gandhi: (VP)
[personal profile] juan_gandhi
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)

Date: 2014-03-25 05:30 pm (UTC)
From: [identity profile] eliah lakhin (from livejournal.com)
А в чем подвох? Вроде же все правильно, не?

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25262728293031

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 25th, 2025 03:05 am
Powered by Dreamwidth Studios