Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. Control Structures and Functi... > Advanced for Loops and for Comprehen...

2.6. Advanced for Loops and for Comprehensions

In the preceding section, you saw the basic form of the for loop. However, this construct is much richer in Scala than in Java or C++. This section covers the advanced features.

You can have multiple generators of the form variable <- expression. Separate them by semicolons. For example,


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial