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.

Tags
#odersky-programming-in-scala-2ed #scala
Question
How to move the condition to the generator in the loop?

for (file <- filesHere)
if (file.getName.endsWith(".scala"))
println(file)



for (file <- filesHere if file.getName.endsWith(".scala"))
println(file)



Tags
#odersky-programming-in-scala-2ed #scala
Question
How to move the condition to the generator in the loop?

for (file <- filesHere)
if (file.getName.endsWith(".scala"))
println(file)


?

Tags
#odersky-programming-in-scala-2ed #scala
Question
How to move the condition to the generator in the loop?

for (file <- filesHere)
if (file.getName.endsWith(".scala"))
println(file)



for (file <- filesHere if file.getName.endsWith(".scala"))
println(file)


If you want to change selection, open document below and click on "Move attachment"

#### pdf

cannot see any pdfs

status measured difficulty not learned 37% [default] 0

### Discussion

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