i.e. actor ! message can be (and is) implemented in a Scala library without needing language extensions. Unified type system Java makes a sharp distinction between primitive types (e.g. int and boolean) and reference types (any class). Only reference types are part of the inheritance scheme, deriving from java.lang.Object. In Scala, all types inherit from a top-level class Any, whose immediate children are AnyVal (value types, such as Int and Boolean) and AnyRef (reference types, as in Java). This means that the Java distinction between primitive types and boxed types (e.g. int vs. Integer) is not present in Scala; boxing and unboxing is completely transparent to the user. Scala 2.10 allows for new value types to be defined by the user. For-expressions Instead of the Java "foreach" loops for looping through an iterator, Scala has for-expressions, which are similar to list comprehensions in languages such as Haskell, or a combination of list comprehensions and generator expressions in Python. For-expressions using the yield keyword allow a new collection to be generated by iterating over an existing one, returning a new collection of the same type. They are translated by the compiler into a series of map, flatMap and filter calls. Where yield is not used, the code approximates to an imperative-style loop, by translating to foreach. A simple example is: val s = for (x <- 1 to 25 if x*x > 50) yield 2*x The result of running it is the following vector: Vector(16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50) (Note that the expression 1 to 25 is not special syntax. The method to is rather defined in the standard Scala library as an extension method on integers, using a technique known as implicit conversions that allows new methods to be added to existing types.) A more complex example of iterating over a map is: // Given a map specifying Twitter users mentioned in a set of tweets, // and number of times each user was mentioned, look up the users // in a map of known politicians, and return a new map giving only the // Democratic politicians (as objects, rather than strings). val dem_mentions = for { (mention, times) <- mentions account <- accounts.get(mention) if account.party == "Democratic" } yield (account, times) Expression (mention, times) <- mentions is an example of pattern matching (see below). Iterating over