Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#scala #sequence-comprehension

no yield keyword - uses the special for comprehension returning Unit:

object ComprehensionTest3 extends App {
  for (i <- Iterator.range(0, 20);
       j <- Iterator.range(i, 20) if i + j == 32)
    println("(" + i + ", " + j + ")")
}
If you want to change selection, open document below and click on "Move attachment"

Sequence Comprehensions - Scala Documentation
that are created from the list of generators and filters are used to perform side-effects. The programmer has to omit the keyword yield to make use of such a sequence comprehension. Here’s a program which is equivalent to the previous one but <span>uses the special for comprehension returning Unit: object ComprehensionTest3 extends App { for (i <- Iterator.range(0, 20); j <- Iterator.range(i, 20) if i + j == 32) println("(" + i + ", " + j + ")") } Please enable JavaScript to view the comments powered by Disqus. blog comments powered by Disqus Contents


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.