Skip to content

Commit 4ae6fab

Browse files
committed
Added additional corrections.
Co-authored-by: SethTisue <[email protected]>
1 parent 13ac4ef commit 4ae6fab

11 files changed

+12
-12
lines changed

_glossary/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can assign an object to a variable. Afterwards, the variable will refer to t
4444
Extra constructors defined inside the curly braces of the class definition, which look like method definitions named `this`, but with no result type.
4545

4646
* #### block
47-
One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the out-side. Such curly braces form a template.
47+
One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the outside. Such curly braces form a template.
4848

4949
* #### bound variable
5050
A bound variable of an expression is a variable that’s both used and defined inside the expression. For instance, in the function literal expression `(x: Int) => (x, y)`, both variables `x` and `y` are used, but only `x` is bound, because it is defined in the expression as an `Int` and the sole argument to the function described by the expression.
@@ -299,7 +299,7 @@ A _self type_ of a trait is the assumed type of `this`, the receiver, to be used
299299
XML data is semi-structured. It is more structured than a flat binary file or text file, but it does not have the full structure of a programming language’s data structures.
300300

301301
* #### serialization
302-
You can _serialize_ an object into a byte stream which can then be saved to file or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
302+
You can _serialize_ an object into a byte stream which can then be saved to a file or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
303303

304304
* #### shadow
305305
A new declaration of a local variable _shadows_ one of the same name in an enclosing scope.

_overviews/collections/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ As always, for-expressions can be used as an alternate syntax for expressions in
2626

2727
for (elem <- it) println(elem)
2828

29-
There's an important difference between the foreach method on iterators and the same method on traversable collections: When called on an iterator, `foreach` will leave the iterator at its end when it is done. So calling `next` again on the same iterator will fail with a `NoSuchElementException`. By contrast, when called on a collection, `foreach` leaves the number of elements in the collection unchanged (unless the passed function adds to remove elements, but this is discouraged, because it may lead to surprising results).
29+
There's an important difference between the foreach method on iterators and the same method on traversable collections: When called on an iterator, `foreach` will leave the iterator at its end when it is done. So calling `next` again on the same iterator will fail with a `NoSuchElementException`. By contrast, when called on a collection, `foreach` leaves the number of elements in the collection unchanged (unless the passed function adds or removes elements, but this is discouraged, because it may lead to surprising results).
3030

3131
The other operations that Iterator has in common with `Traversable` have the same property. For instance, iterators provide a `map` method, which returns a new iterator:
3232

_overviews/collections/migrating-from-scala-27.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Generally, the old functionality of Scala 2.7 collections has been left in place
3838

3939
There are two parts of the old libraries which have been replaced wholesale, and for which deprecation warnings were not feasible.
4040

41-
1. The previous `scala.collection.jcl` package is gone. This package tried to mimic some Java collection library design in Scala, but in doing so broke many symmetries. Most people who wanted Java collections bypassed `jcl` and used `java.util` directly. Scala 2.8 offers automatic conversion mechanisms between both collection libraries in the [JavaConversions]({{ site.baseurl }}/overviews/collections/conversions-between-java-and-scala-collections.html) object which replaces the `jcl` package.
41+
1. The previous `scala.collection.jcl` package is gone. This package tried to mimic aspects of the Java collection library design in Scala, but in doing so broke many symmetries. Most people who wanted Java collections bypassed `jcl` and used `java.util` directly. Scala 2.8 offers automatic conversion mechanisms between both collection libraries in the [JavaConversions]({{ site.baseurl }}/overviews/collections/conversions-between-java-and-scala-collections.html) object which replaces the `jcl` package.
4242
2. Projections have been generalized and cleaned up and are now available as views. It seems that projections were used rarely, so not much code should be affected by this change.
4343

4444
So, if your code uses either `jcl` or projections there might be some minor rewriting to do.

_overviews/collections/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Like arrays, strings are not directly sequences, but they can be converted to th
2626
scala> val s: Seq[Char] = str
2727
s: Seq[Char] = WrappedString(h, e, l, l, o)
2828

29-
These operations are supported by two implicit conversions. The first, low-priority conversion maps a `String` to a `WrappedString`, which is a subclass of `immutable.IndexedSeq`, This conversion got applied in the last line above where a string got converted into a Seq. the other, high-priority conversion maps a string to a `StringOps` object, which adds all methods on immutable sequences to string. This conversion was implicitly inserted in the method calls of `reverse`, `map`, `drop`, and `slice` in the example above.
29+
These operations are supported by two implicit conversions. The first, low-priority conversion maps a `String` to a `WrappedString`, which is a subclass of `immutable.IndexedSeq`, This conversion got applied in the last line above where a string got converted into a Seq. the other, high-priority conversion maps a string to a `StringOps` object, which adds all methods on immutable sequences to strings. This conversion was implicitly inserted in the method calls of `reverse`, `map`, `drop`, and `slice` in the example above.

_overviews/collections/trait-traversable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The `foreach` method is meant to traverse all elements of the collection, and ap
2525
* **Conversions** `toArray`, `toList`, `toIterable`, `toSeq`, `toIndexedSeq`, `toStream`, `toSet`, `toMap`, which turn a `Traversable` collection into something more specific. All these conversions return their receiver argument unchanged if the run-time type of the collection already matches the demanded collection type. For instance, applying `toList` to a list will yield the list itself.
2626
* **Copying operations** `copyToBuffer` and `copyToArray`. As their names imply, these copy collection elements to a buffer or array, respectively.
2727
* **Size info** operations `isEmpty`, `nonEmpty`, `size`, and `hasDefiniteSize`: Traversable collections can be finite or infinite. An example of an infinite traversable collection is the stream of natural numbers `Stream.from(0)`. The method `hasDefiniteSize` indicates whether a collection is possibly infinite. If `hasDefiniteSize` returns true, the collection is certainly finite. If it returns false, the collection has not been fully elaborated yet, so it might be infinite or finite.
28-
* **Element retrieval** operations `head`, `last`, `headOption`, `lastOption`, and `find`. These select the first or last element of a collection, or else the first element matching a condition. Note, however, that not all collections have a well-defined meaning of what "first" and "last" means. For instance, a hash set might store elements according to their hash keys, which might change from run to run. In that case, the "first" element of a hash set could also be different for every run of a program. A collection is _ordered_ if it always yields its elements in the same order. Most collections are ordered, but some (_e.g._ hash sets) are not-- dropping the ordering gives a little of extra efficiency. Ordering is often essential to give reproducible tests and to help in debugging. That's why Scala collections give ordered alternatives for all collection types. For instance, the ordered alternative for `HashSet` is `LinkedHashSet`.
28+
* **Element retrieval** operations `head`, `last`, `headOption`, `lastOption`, and `find`. These select the first or last element of a collection, or else the first element matching a condition. Note, however, that not all collections have a well-defined meaning of what "first" and "last" means. For instance, a hash set might store elements according to their hash keys, which might change from run to run. In that case, the "first" element of a hash set could also be different for every run of a program. A collection is _ordered_ if it always yields its elements in the same order. Most collections are ordered, but some (_e.g._ hash sets) are not-- dropping the ordering gives a little extra efficiency. Ordering is often essential to give reproducible tests and to help in debugging. That's why Scala collections give ordered alternatives for all collection types. For instance, the ordered alternative for `HashSet` is `LinkedHashSet`.
2929
* **Sub-collection retrieval operations** `tail`, `init`, `slice`, `take`, `drop`, `takeWhile`, `dropWhile`, `filter`, `filterNot`, `withFilter`. These all return some sub-collection identified by an index range or some predicate.
3030
* **Subdivision operations** `splitAt`, `span`, `partition`, `groupBy`, which split the elements of this collection into several sub-collections.
3131
* **Element tests** `exists`, `forall`, `count` which test collection elements with a given predicate.

_overviews/contribute/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ without creating an issue, but please look to see if there is an issue already s
4242
and more
4343

4444
Please read [Add New Guides/Tutorials][add-guides] through before embarking on changes. The site uses
45-
the [Jekyll](https://jekyllrb.com/) markdown engine, so you will need to follow the instructions to get that running as well.
45+
the [Jekyll](https://jekyllrb.com/) Markdown engine, so you will need to follow the instructions to get that running as well.
4646

4747
### Updating scala-lang.org
4848

_overviews/contribute/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Scala programming language is an open source project with a very
88
diverse community, where people from all over the world contribute their work,
99
with everyone benefiting from friendly help and advice, and
1010
kindly helping others in return. So why not join the Scala community and help
11-
everyone to make things better?
11+
everyone make things better?
1212

1313
**What Can I Do?**
1414
That depends on what you want to contribute. Below are some getting started resources for different contribution domains. Please read all the documentation and follow all the links from the topic pages below before attempting to contribute, as many of the questions you have will already be answered.

_overviews/contributors/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ or for publishing the resulting documentation to a web server.
370370
Finally, a simple solution for publishing the documentation online consists in using the
371371
[GitHub Pages](https://pages.github.com/) service, which is automatically available for each GitHub
372372
repository. The [sbt-ghpages](https://github.com/sbt/sbt-ghpages) plugin can automatically upload
373-
a sbt-site to GitHub Pages.
373+
an sbt-site to GitHub Pages.
374374

375375
### Create the Documentation Site
376376

_overviews/core/architecture-of-scala-collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ maps the key/value pair to an integer, namely its value component. In
217217
that case, we cannot form a `Map` from the results, but we can still
218218
form an `Iterable`, a supertrait of `Map`.
219219

220-
You might ask why not restrict `map` so that it can always return the
220+
You might ask why, not restrict `map` so that it can always return the
221221
same kind of collection? For instance, on bit sets `map` could accept
222222
only `Int`-to-`Int` functions and on `Map`s it could only accept
223223
pair-to-pair functions. Not only are such restrictions undesirable

_overviews/core/custom-collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ That is it. The final [`Capped` class](#final-version-of-capped-class):
337337
`knownSize` operation is also overridden because the size is always
338338
known.
339339

340-
Its implementation requires a little of protocol. In essence, you
340+
Its implementation requires a little bit of protocol. In essence, you
341341
have to inherit from the `Ops` template trait in addition to just
342342
inheriting from a collection type, override the `iterableFactory`
343343
member to return a more specific factory, and finally implement abstract

_overviews/reflection/symbols-trees-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ with different type arguments.
298298
scala> getType(List(1,2,3)) =:= getType(List(9,8,7))
299299
res2: Boolean = true
300300

301-
Also, important to note is that `=:=` should _always_ be used to compare types
301+
Also important to note is that `=:=` should _always_ be used to compare types
302302
for equality. That is, never use `==`, as it can't check for type equality in
303303
the presence of type aliases, whereas `=:=` can:
304304

0 commit comments

Comments
 (0)