Created
December 16, 2010 16:24
-
-
Save teamon/743598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0 to Int.MaxValue) == Range() // empty! | |
class X extends Actor { | |
def act { | |
val a = actor { | |
loop { | |
receive { // FAIL, must use 'self.receive' | |
case ... | |
} | |
} | |
} | |
} | |
} | |
class X extends Actor { | |
def act { | |
loop { | |
computeSomething (not react/receive) // FAIL, it blocks all actors | |
} | |
} | |
} | |
def gimmeSize[A,B](m: Map[A,B]) = m.size | |
val m = scala.collection.mutable.Map[String, Int]() | |
gimmeSize(m) | |
//<console>:8: error: type mismatch; | |
// found : scala.collection.mutable.Map[String,Int] | |
// required: Map[?,?] | |
// s(m) | |
// By default 'Map' is 'scala.collection.immutable.Map' and shared trait betwen | |
// mutable and immutable map is 'scala.collection.Map' | |
// Correct version: | |
def gimmeSize[A,B](m: scala.collection.Map[A,B]) = m.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment