November 2009
1 post
2 tags
A Look at How Scala Compiles to Java
Consider this contrived example, based on an example from Beginning Scala. The point of the snippet was to demonstrate the congruency between using the higher-order functions map, flatMap, foreach, and filter (see Iterable), and performing the same operations inside a for comprehension. object App { def isEven(i: Int) = i % 2 == 0 def isOdd(i: Int) = i % 2 == 1 def main(args:...
Nov 11th
10 notes