How to use the Scala For statement segment
This article introduces the knowledge of "how to use Scala For sentence segments". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
For statement segment
Syntax:
Expr1:: = "for" ("(" Enumerators ")" | "{" Enumerators
"}") {nl} ["yield"] Expr
Enumerators:: = Generator {semi Enumerator}
Enumerator:: = Generator
| | Guard |
| | "val" Pattern1 "=" Expr |
Generator:: = Pattern1 "