icon-cookie
The website uses cookies to optimize your user experience. Using this website grants us the permission to collect certain information essential to the provision of our services to you, but you may change the cookie settings within your browser any time you wish. Learn more
I agree
Summary | 9 Annotations
The default case is specified with an underscore (_)
2018/10/03 07:56
, a wildcard symbol frequently used in Scala as a placeholder for a completely unknown value.
2018/10/03 07:56
Scala's match expression lets you select from a number of alternatives, just like switch statements in other languages
2018/10/03 07:56
match {     case "salt" =
2018/10/03 07:56
case
2018/10/03 07:56
match
2018/10/03 07:56
Another difference is that there are no breaks at the end of each alternative. Instead the break is implicit,
2018/10/03 07:57
match expressions result in a value.
2018/10/03 07:57
The simplest approach is to replace every continue by an if and every break by a boolean variable.
2018/10/03 08:00