8000 Be explicit about need of wrapping multi-line expressions with {} · soronpo/scala.github.com@65bc35b · GitHub
[go: up one dir, main page]

Skip to content

Commit 65bc35b

Browse files
committed
Be explicit about need of wrapping multi-line expressions with {}
1 parent f956e3c commit 65bc35b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/tour/basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ You can define functions that returns a given integer + 1 like below.
5959
(x: Int) => x + 1
6060
```
6161

62-
Left hand side of `=>` is parameter(s) and right hand side of it is body.
62+
Left hand side of `=>` is parameter(s) and right hand side of `=>` is body.
6363

6464
Notice that the function has no `return` keyword. This is because, in Scala, the last expression of the function is automatically returned.
6565

@@ -84,7 +84,7 @@ val getTheAnswer = () => 42
8484
println(getTheAnswer()) // 42
8585
```
8686

87-
If your function body spans across multiple lines, you can wrap them with `{}`.
87+
If your function body spans across multiple lines, you must wrap them with `{}`.
8888

8989
```
9090
val greet = (name: String) => {

0 commit comments

Comments
 (0)
0