Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
spec: fix broken links and anchors, including examples
For examples, the "name" of the example (like "Example Ordered") is only
used to derived its html id so that one can link to it (see
`layouts/default.yml`). Ideally all examples should have a name; here I
only added enough to satisfy existing links.
  • Loading branch information
gourlaysama committed Sep 17, 2014
commit d24ad908451e42925fe6be9995235bf2b4de1b39
6 changes: 3 additions & 3 deletions spec/01-lexical-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ between the two tokens. However, if two tokens are separated by at
least one completely blank line (i.e a line which contains no
printable characters), then two `nl` tokens are inserted.

The Scala grammar (given in full [here](#scala-syntax-summary))
The Scala grammar (given in full [here](13-syntax-summary.html))
contains productions where optional `nl` tokens, but not
semicolons, are accepted. This has the effect that a newline in one of these
positions does not terminate an expression or statement. These positions can
Expand All @@ -202,7 +202,7 @@ A single new line token is accepted

- in front of an opening brace ‘{’, if that brace is a legal
continuation of the current statement or expression,
- after an [infix operator](06-expressions.html#prefix-infix-and-postfix-operations),
- after an [infix operator](06-expressions.html#prefix,-infix,-and-postfix-operations),
if the first token on the next line can start an expression,
- in front of a [parameter clause](04-basic-declarations-and-definitions.html#function-declarations-and-definitions), and
- after an [annotation](11-user-defined-annotations.html#user-defined-annotations).
Expand Down Expand Up @@ -498,7 +498,7 @@ lines.
```

Method `stripMargin` is defined in class
[scala.collection.immutable.StringLike](http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.StringLike).
[scala.collection.immutable.StringLike](http://www.scala-lang.org/api/current/#scala.collection.immutable.StringLike).
Because there is a predefined
[implicit conversion](06-expressions.html#implicit-conversions) from `String` to
`StringLike`, the method is applicable to all strings.
Expand Down
6 changes: 3 additions & 3 deletions spec/03-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ well-formed if each actual type parameter
_conforms to its bounds_, i.e. $\sigma L_i <: T_i <: \sigma U_i$ where $\sigma$ is the
substitution $[ a_1 := T_1 , \ldots , a_n := T_n ]$.

### Example
### Example Parameterized Types
Given the partial type definitions:

```scala
Expand All @@ -204,7 +204,7 @@ G[S, String]

### Example

Given the [above type definitions](example-parameterized-types),
Given the [above type definitions](#example-parameterized-types),
the following types are ill-formed:

```scala
Expand Down Expand Up @@ -349,7 +349,7 @@ $T_2$. The type is equivalent to the type application
arbitrary identifier.

All type infix operators have the same precedence; parentheses have to
be used for grouping. The [associativity](06-expressions.html#prefix-infix-and-postfix-operations)
be used for grouping. The [associativity](06-expressions.html#prefix,-infix,-and-postfix-operations)
of a type operator is determined as for term operators: type operators
ending in a colon ‘:’ are right-associative; all other
operators are left-associative.
Expand Down
3 changes: 2 additions & 1 deletion spec/05-classes-and-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Then the linearization of class `Iter` is
Note that the linearization of a class refines the inheritance
relation: if $C$ is a subclass of $D$, then $C$ precedes $D$ in any
linearization where both $C$ and $D$ occur.
[Linearization](#definition-linearization) also satisfies the property that
[Linearization](#definition:-linearization) also satisfies the property that
a linearization of a class always contains the linearization of its direct superclass as a suffix.

For instance, the linearization of `StringIterator` is
Expand Down Expand Up @@ -753,6 +753,7 @@ val c = new C(1, "abc", List())
c.z = c.y :: c.z
```

### Example Private Constructor
The following class can be created only from its companion module.

```scala
Expand Down
8 changes: 4 additions & 4 deletions spec/06-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ A designator refers to a named term. It can be a _simple name_ or
a _selection_.

A simple name $x$ refers to a value as specified
[here](02-identifiers-names-and-scopes.html#identifiers-names-and-scopes).
[here](02-identifiers-names-and-scopes.html#identifiers,-names-and-scopes).
If $x$ is bound by a definition or declaration in an enclosing class
or object $C$, it is taken to be equivalent to the selection
`$C$.this.$x$` where $C$ is taken to refer to the class containing $x$
even if the type name $C$ is [shadowed](02-identifiers-names-and-scopes.html#identifiers-names-and-scopes) at the
even if the type name $C$ is [shadowed](02-identifiers-names-and-scopes.html#identifiers,-names-and-scopes) at the
occurrence of $x$.

If $r$ is a [stable identifier](03-types.html#paths) of type $T$, the selection $r.x$ refers
Expand Down Expand Up @@ -802,7 +802,7 @@ Here are some assignment expressions and their equivalent expansions.
|`x.f(i) = e` | `x.f.update(i, e)` |
|`x.f(i, j) = e` | `x.f.update(i, j, e)`|

### Example
### Example Imperative Matrix Multiplication

Here is the usual imperative code for matrix multiplication.

Expand Down Expand Up @@ -1115,7 +1115,7 @@ Expr1 ::= `try' `{' Block `}' [`catch' `{' CaseClauses `}']

A try expression is of the form `try { $b$ } catch $h$`
where the handler $h$ is a
[pattern matching anonymous function](#pattern-matching-anonymous-functions)
[pattern matching anonymous function](08-pattern-matching.html#pattern-matching-anonymous-functions)

```scala
{ case $p_1$ => $b_1$ $\ldots$ case $p_n$ => $b_n$ }
Expand Down
6 changes: 3 additions & 3 deletions spec/07-implicit-parameters-and-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and can be used as implicit conversions called [views](#views).
The `implicit` modifier is illegal for all
type members, as well as for [top-level objects](09-top-level-definitions.html#packagings).

### Example
### Example Monoid
The following code defines an abstract class of monoids and
two concrete implementations, `StringMonoid` and
`IntMonoid`. The two implementations are marked implicit.
Expand Down Expand Up @@ -189,7 +189,7 @@ core type is added to the stack, it is checked that this type does not
dominate any of the other types in the set.

Here, a core type $T$ _dominates_ a type $U$ if $T$ is
[equivalent](03-types.html#type-equivalence)
[equivalent](03-types.html#equivalence)
to $U$, or if the top-level type constructors of $T$ and $U$ have a
common element and $T$ is more complex than $U$.

Expand Down Expand Up @@ -284,7 +284,7 @@ As for implicit parameters, overloading resolution is applied
if there are several possible candidates (of either the call-by-value
or the call-by-name category).

### Example
### Example Ordered
Class `scala.Ordered[A]` contains a method

```scala
Expand Down
2 changes: 1 addition & 1 deletion spec/08-pattern-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ p_n$.
An infix operation pattern $p;\mathit{op};q$ is a shorthand for the
constructor or extractor pattern $\mathit{op}(p, q)$. The precedence and
associativity of operators in patterns is the same as in
[expressions](06-expressions.html#prefix-infix-and-postfix-operations).
[expressions](06-expressions.html#prefix,-infix,-and-postfix-operations).

An infix operation pattern $p;\mathit{op};(q_1 , \ldots , q_n)$ is a
shorthand for the constructor or extractor pattern $\mathit{op}(p, q_1
Expand Down