In Chapter 3 of Programming Scala, the author gives two examples of for loops / for comprehensions, but switches between using ()'s and {}'s. Why is this the case, as these inherently look like they're doing the same thing? Is there a reason breed <- dogBreeds
is on the 2nd line in example #2?
// #1 ()'s
for (breed <- dogBreeds
if breed.contains("Terrier");
if !breed.startsWith("Yorkshire")
) println(breed)
// #2 {}'s
for {
breed <- dogBreeds
upcasedBreed = breed.toUpperCase()
} println(upcasedBreed)