|
|
|
|
|
by yawaramin
1393 days ago
|
|
Scala 3 actually doesn't really eliminate braces in any meaningful way. Sure, they're optional for delimiting traits, classes, and objects. But braces are heavily used for block scoping in Scala too. E.g. a very common pattern: retry(Seq(1.second, 2.second, 3.second)) {
// some action that can fail
}
This still requires the braces as of right now. I think the syntax changes will just confuse more people than it helps, at least for the time being. |
|
you can also use import language.experimental.fewerBraces with nightly builds to write code like this
List(1,2,3).map: c => ...