#scala #sequence-comprehension
A comprehension evaluates the body e  (as in for (enumerators) yield e) for each binding generated by the enumerators and returns a sequence of these values.
If you want to change selection, open document below and click on "Move attachment"

Sequence Comprehensions - Scala Documentation
ing sequence comprehensions. Comprehensions have the form for (enumerators) yield e, where enumerators refers to a semicolon-separated list of enumerators. An enumerator is either a generator which introduces new variables, or it is a filter. <span>A comprehension evaluates the body e for each binding generated by the enumerators and returns a sequence of these values. Here is an example: object ComprehensionTest1 extends App { def even(from: Int, to: Int): List[Int] = for (i <- List.range(from, to) if i % 2 == 0) yield i Console.println(ev