Skip to content

Commit 3c24f46

Browse files
Merge pull request #532 from vivekimsit/typo-creating-collections
Fix typo.
2 parents 763f341 + 969629e commit 3c24f46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overviews/collections/creating-collections-from-scratch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You have syntax `List(1, 2, 3)` to create a list of three integers and `Map('A'
2424

2525
List.apply(1.0, 2.0)
2626

27-
So this is a call to the `apply` method of the companion object of the `List` class. That method takes an arbitrary number of arguments an constructs a list from them. Every collection class in the Scala library has a companion object with such an `apply` method. It does not matter whether the collection class represents a concrete implementation, like `List`, or `Stream` or `Vector`, do, or whether it is an abstract base class such as `Seq`, `Set` or `Traversable`. In the latter case, calling apply will produce some default implementation of the abstract base class. Examples:
27+
So this is a call to the `apply` method of the companion object of the `List` class. That method takes an arbitrary number of arguments and constructs a list from them. Every collection class in the Scala library has a companion object with such an `apply` method. It does not matter whether the collection class represents a concrete implementation, like `List`, or `Stream` or `Vector`, do, or whether it is an abstract base class such as `Seq`, `Set` or `Traversable`. In the latter case, calling apply will produce some default implementation of the abstract base class. Examples:
2828

2929
scala> List(1, 2, 3)
3030
res17: List[Int] = List(1, 2, 3)
@@ -55,4 +55,4 @@ Descendants of `Seq` classes provide also other factory operations in their comp
5555
| `S.tabulate(m, n){f}` | A sequence of sequences of dimension `m×n` where the element at each index `(i, j)` is computed by `f(i, j)`. (exists also in higher dimensions). |
5656
| `S.range(start, end)` | The sequence of integers `start` ... `end-1`. |
5757
| `S.range(start, end, step)`| The sequence of integers starting with `start` and progressing by `step` increments up to, and excluding, the `end` value. |
58-
| `S.iterate(x, n)(f)` | The sequence of length `n` with elements `x`, `f(x)`, `f(f(x))`, ... |
58+
| `S.iterate(x, n)(f)` | The sequence of length `n` with elements `x`, `f(x)`, `f(f(x))`, ... |

0 commit comments

Comments
 (0)