Skip to content

Commit 85b0cb2

Browse files
erguvenb-studios
authored andcommitted
Fix wrong list name
1 parent 905dbca commit 85b0cb2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_overviews/scala3-book/taste-control-structures.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,17 @@ A few examples demonstrate this.
103103
Using the same `ints` list as the previous example, this code creates a new list, where the value of each element in the new list is twice the value of the elements in the original list:
104104

105105
````
106-
scala> val doubles = for i <- nums yield i * 2
106+
scala> val doubles = for i <- ints yield i * 2
107107
val doubles: List[Int] = List(2, 4, 6, 8, 10)
108108
````
109109

110110
Scala’s control structure syntax is flexible, and that `for` expression can be written in several other ways, depending on your preference:
111111

112112
```scala
113-
val doubles = for i <- nums yield i * 2 // style shown above
114-
val doubles = for (i <- nums) yield i * 2
115-
val doubles = for (i <- nums) yield (i * 2)
116-
val doubles = for { i <- nums } yield (i * 2)
113+
val doubles = for i <- ints yield i * 2 // style shown above
114+
val doubles = for (i <- ints) yield i * 2
115+
val doubles = for (i <- ints) yield (i * 2)
116+
val doubles = for { i <- ints } yield (i * 2)
117117
```
118118

119119
This example shows how to capitalize the first character in each string in the list:

0 commit comments

Comments
 (0)