<=
is just like you would "read" it: 'less than or equals'. So it's a mathematical operator, in the list of <
(is less than?), >
(is greater than?), ==
(equals?), !=
(is not equal?), <=
(is less than or equal?), and >=
(is greater than or equal?).
This must not be confused with =>
which is kind of a double right-hand arrow, used to separate the argument list from the body of a function and to separate the testing condition in pattern matching (a case
block) from the body executed when a match occurs. You can see example of this in my previous two answers. First, the function use:
coll.map(tup => tup._2.reverse)
which is already abbreviated as the types are omitted. The follow function would be
// function arguments function body
(tup: Tuple2[Int, String]) => tup._2.reverse
and the pattern matching use:
def extract2(l: List[Int]) = l match {
// if l matches Nil return "empty"
case Nil => "empty"
// etc.
case ::(head, Nil) => "exactly one element (" + head + ")"
// etc.
case ::(head, tail) => "more than one element"
}