Methods with Function Parameters

Scala

scala> val isEven = (x: Int) => x%2 == 0 
isEven: (Int) => Boolean = <function>

scala> List(2,3,5,7).partition(isEven)  
res8: (List[Int], List[Int]) = (List(2),List(3, 5, 7))


Ruby

>> [2,3,5,7].partition {|x| x % 2 == 0 }
=> [[2], [3, 5, 7]]