Permalink
Browse files

That was fun: fix internal links.

After some dirty grepping, regexing and perling, I present to you: internal links!

I wish there was a way to make this more robust, these will only work on the html version,
and assume we don't change filenames...
  • Loading branch information...
1 parent d8a09e2 commit e6ecfd0de12ecda56cc23f887c807c3ae096c82d @adriaanm adriaanm committed Mar 14, 2014
View
@@ -190,23 +190,23 @@ that a semicolon in place of the newline would be illegal in every one
of these cases):
- between the condition of a
- [conditional expression](#conditional-expressions)
- or [while loop](#while-loop-expressions) and the next
+ [conditional expression](08-expressions.html#conditional-expressions)
+ or [while loop](08-expressions.html#while-loop-expressions) and the next
following expression,
- between the enumerators of a
- [for-comprehension](#for-comprehensions-and-for-loops)
+ [for-comprehension](08-expressions.html#for-comprehensions-and-for-loops)
and the next following expression, and
- after the initial `type` keyword in a
- [type definition or declaration](#type-declarations-and-type-aliases).
+ [type definition or declaration](06-basic-declarations-and-definitions.html#type-declarations-and-type-aliases).
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](#prefix-infix-and-postfix-operations),
+- after an [infix operator](08-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](#function-declarations-and-definitions), and
-- after an [annotation](#user-defined-annotations).
+- in front of a [parameter clause](06-basic-declarations-and-definitions.html#function-declarations-and-definitions), and
+- after an [annotation](13-user-defined-annotations.html#user-defined-annotations).
###### Example: four well-formed statements, each on two lines
@@ -344,7 +344,7 @@ type `Long` are all integer numbers between $-2^{63}$ and
$2^{63}-1$, inclusive. A compile-time error occurs if an integer literal
denotes a number outside these ranges.
-However, if the expected type [_pt_](#expression-typing) of a literal
+However, if the expected type [_pt_](08-expressions.html#expression-typing) of a literal
in an expression is either `Byte`, `Short`, or `Char`
and the integer number fits in the numeric range defined by the type,
then the number is converted to type _pt_ and the literal's type
@@ -507,7 +507,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).
Because there is a predefined
-[implicit conversion](#implicit-conversions) from `String` to
+[implicit conversion](08-expressions.html#implicit-conversions) from `String` to
`StringLike`, the method is applicable to all strings.
@@ -542,7 +542,7 @@ symbolLiteral ::= ‘'’ plainid
```
A symbol literal `'x` is a shorthand for the expression
-`scala.Symbol("x")`. `Symbol` is a [case class](#case-classes),
+`scala.Symbol("x")`. `Symbol` is a [case class](07-classes-and-objects.html#case-classes),
which is defined as follows.
```
@@ -7,10 +7,10 @@ layout: default
Names in Scala identify types, values, methods, and classes which are
collectively called _entities_. Names are introduced by local
-[definitions and declarations](#basic-declarations-and-definitions),
-[inheritance](#class-members),
-[import clauses](#import-clauses), or
-[package clauses](#packagings)
+[definitions and declarations](06-basic-declarations-and-definitions.html#basic-declarations-and-definitions),
+[inheritance](07-classes-and-objects.html#class-members),
+[import clauses](06-basic-declarations-and-definitions.html#import-clauses), or
+[package clauses](11-top-level-definitions.html#packagings)
which are collectively called _bindings_.
Bindings of different kinds have a precedence defined on them:
@@ -24,8 +24,8 @@ Bindings of different kinds have a precedence defined on them:
compilation unit where the definition occurs have lowest precedence.
-There are two different name spaces, one for [types](#types)
-and one for [terms](#expressions). The same name may designate a
+There are two different name spaces, one for [types](05-types.html#types)
+and one for [terms](08-expressions.html#expressions). The same name may designate a
type and a term, depending on the context where the name is used.
A binding has a _scope_ in which the entity defined by a single
@@ -103,6 +103,6 @@ object A {
A reference to a qualified (type- or term-) identifier $e.x$ refers to
the member of the type $T$ of $e$ which has the name $x$ in the same
namespace as the identifier. It is an error if $T$ is not a
-[value type](#value-types). The type of $e.x$ is the member type of the
+[value type](05-types.html#value-types). The type of $e.x$ is the member type of the
referenced entity in $T$.
View
@@ -34,15 +34,15 @@ Value types are either _concrete_ or _abstract_.
Every concrete value type can be represented as a _class type_, i.e. a
[type designator](#type-designators) that refers to a
-[class or a trait](#class-definitions) [^1], or as a
+[class or a trait](07-classes-and-objects.html#class-definitions) [^1], or as a
[compound type](#compound-types) representing an
intersection of types, possibly with a [refinement](#compound-types)
that further constrains the types of its members.
<!--
A shorthand exists for denoting [function types](#function-types)
-->
-Abstract value types are introduced by [type parameters](#type-parameters)
-and [abstract type bindings](#type-declarations-and-type-aliases).
+Abstract value types are introduced by [type parameters](06-basic-declarations-and-definitions.html#type-parameters)
+and [abstract type bindings](06-basic-declarations-and-definitions.html#type-declarations-and-type-aliases).
Parentheses in types can be used for grouping.
[^1]: We assume that objects and packages also implicitly
@@ -107,7 +107,7 @@ SimpleType ::= Path ‘.’ type
```
A singleton type is of the form `$p$.type`, where $p$ is a
-path pointing to a value expected to [conform](#expression-typing)
+path pointing to a value expected to [conform](08-expressions.html#expression-typing)
to `scala.AnyRef`. The type denotes the set of values
consisting of `null` and the value denoted by $p$.
@@ -258,7 +258,7 @@ AnnotType ::= SimpleType {Annotation}
```
An annotated type $T$ `$a_1 , \ldots , a_n$`
-attaches [annotations](#user-defined-annotations)
+attaches [annotations](13-user-defined-annotations.html#user-defined-annotations)
$a_1 , \ldots , a_n$ to the type $T$.
###### Example: annotated type
@@ -287,7 +287,7 @@ $T_1 , \ldots , T_n$ and the refinement `{ $R$ }`. A refinement
`{ $R$ }` contains declarations and type definitions.
If a declaration or definition overrides a declaration or definition in
one of the component types $T_1 , \ldots , T_n$, the usual rules for
-[overriding](#overriding) apply; otherwise the declaration
+[overriding](07-classes-and-objects.html#overriding) apply; otherwise the declaration
or definition is said to be “structural” [^2].
[^2]: A reference to a structurally defined member (method call or access
@@ -354,10 +354,10 @@ $T_2$. The type is equivalent to the type application
`$\mathit{op}$[$T_1$, $T_2$]`. The infix operator $\mathit{op}$ may be an
arbitrary identifier,
except for `*`, which is reserved as a postfix modifier
-denoting a [repeated parameter type](#repeated-parameters).
+denoting a [repeated parameter type](06-basic-declarations-and-definitions.html#repeated-parameters).
All type infix operators have the same precedence; parentheses have to
-be used for grouping. The [associativity](#prefix-infix-and-postfix-operations)
+be used for grouping. The [associativity](08-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.
@@ -384,7 +384,7 @@ values that take arguments of types $T1 , \ldots , Tn$ and yield
results of type $U$. In the case of exactly one argument type
$T \Rightarrow U$ is a shorthand for $(T) \Rightarrow U$.
An argument type of the form $\Rightarrow T$
-represents a [call-by-name parameter](#by-name-parameters) of type $T$.
+represents a [call-by-name parameter](06-basic-declarations-and-definitions.html#by-name-parameters) of type $T$.
Function types associate to the right, e.g.
$S \Rightarrow T \Rightarrow U$ is the same as
@@ -404,7 +404,7 @@ trait Function_n[-T1 , … , -T$_n$, +R] {
}
```
-Hence, function types are [covariant](#variance-annotations) in their
+Hence, function types are [covariant](06-basic-declarations-and-definitions.html#variance-annotations) in their
result type and contravariant in their argument types.
### Existential Types
@@ -419,7 +419,7 @@ ExistentialDcl ::= ‘type’ TypeDcl
An existential type has the form `$T$ forSome { $Q$ }`
where $Q$ is a sequence of
-[type declarations](#type-declarations-and-type-aliases).
+[type declarations](06-basic-declarations-and-definitions.html#type-declarations-and-type-aliases).
Let
$t_1[\mathit{tps}_1] >: L_1 <: U_1 , \ldots , t_n[\mathit{tps}_n] >: L_n <: U_n$
@@ -461,7 +461,7 @@ is equivalent to
1. An existential type `$T$ forSome { $Q$ }` where $Q$ contains
a clause `type $t[\mathit{tps}] >: L <: U$` is equivalent
to the type `$T'$ forSome { $Q$ }` where $T'$ results from $T$ by replacing
-every [covariant occurrence](#variance-annotations) of $t$ in $T$ by $U$ and by
+every [covariant occurrence](06-basic-declarations-and-definitions.html#variance-annotations) of $t$ in $T$ by $U$ and by
replacing every contravariant occurrence of $t$ in $T$ by $L$.
@@ -590,7 +590,7 @@ that are re-evaluated each time the parameterless method name is
referenced.
Method types do not exist as types of values. If a method name is used
-as a value, its type is [implicitly converted](#implicit-conversions) to a
+as a value, its type is [implicitly converted](08-expressions.html#implicit-conversions) to a
corresponding function type.
###### Example
@@ -644,8 +644,8 @@ union : [A >: Nothing <: Comparable[A]] (x: Set[A], xs: Set[A]) Set[A] .
A type constructor is represented internally much like a polymorphic method type.
`[$\pm$ $a_1$ >: $L_1$ <: $U_1 , \ldots , \pm a_n$ >: $L_n$ <: $U_n$] $T$`
represents a type that is expected by a
-[type constructor parameter](#type-parameters) or an
-[abstract type constructor binding](#type-declarations-and-type-aliases) with
+[type constructor parameter](06-basic-declarations-and-definitions.html#type-parameters) or an
+[abstract type constructor binding](06-basic-declarations-and-definitions.html#type-declarations-and-type-aliases) with
the corresponding type parameter clause.
###### Example
@@ -20,8 +20,8 @@ Def ::= PatVarDef
```
A _declaration_ introduces names and assigns them types. It can
-form part of a [class definition](#templates) or of a
-refinement in a [compound type](#compound-types).
+form part of a [class definition](07-classes-and-objects.html#templates) or of a
+refinement in a [compound type](05-types.html#compound-types).
A _definition_ introduces names that denote terms or types. It can
form part of an object or class definition or it can be local to a
@@ -115,7 +115,7 @@ type $T$.
A value definition `val $x$: $T$ = $e$` defines $x$ as a
name of the value that results from the evaluation of $e$.
If the value definition is not recursive, the type
-$T$ may be omitted, in which case the [packed type](#expression-typing) of
+$T$ may be omitted, in which case the [packed type](08-expressions.html#expression-typing) of
expression $e$ is assumed. If a type $T$ is given, then $e$ is expected to
conform to it.
@@ -131,13 +131,13 @@ A _constant value definition_ is of the form
final val x = e
```
-where `e` is a [constant expression](#constant-expressions).
+where `e` is a [constant expression](08-expressions.html#constant-expressions).
The `final` modifier must be
present and no type annotation may be given. References to the
constant value `x` are themselves treated as constant expressions; in the
generated code they are replaced by the definition's right-hand side `e`.
-Value definitions can alternatively have a [pattern](#patterns)
+Value definitions can alternatively have a [pattern](10-pattern-matching.html#patterns)
as left-hand side. If $p$ is some pattern other
than a simple name or a name followed by a colon and a type, then the
value definition `val $p$ = $e$` is expanded as follows:
@@ -222,9 +222,9 @@ A variable definition `var $x$: $T$ = $e$` introduces a
mutable variable with type $T$ and initial value as given by the
expression $e$. The type $T$ can be omitted, in which case the type of
$e$ is assumed. If $T$ is given, then $e$ is expected to
-[conform to it](#expression-typing).
+[conform to it](08-expressions.html#expression-typing).
-Variable definitions can alternatively have a [pattern](#patterns)
+Variable definitions can alternatively have a [pattern](10-pattern-matching.html#patterns)
as left-hand side. A variable definition
`var $p$ = $e$` where $p$ is a pattern other
than a simple name or a name followed by a colon and a type is expanded in the same way
@@ -325,7 +325,7 @@ the top type `scala.Any` is assumed.
A type constructor declaration imposes additional restrictions on the
concrete types for which $t$ may stand. Besides the bounds $L$ and
$U$, the type parameter clause may impose higher-order bounds and
-variances, as governed by the [conformance of type constructors](#conformance).
+variances, as governed by the [conformance of type constructors](05-types.html#conformance).
The scope of a type parameter extends over the bounds `>: $L$ <: $U$` and the type parameter clause $\mathit{tps}$ itself. A
higher-order type parameter clause (of an abstract type constructor
@@ -413,7 +413,7 @@ function definitions. In this section we consider only type parameter
definitions with lower bounds `>: $L$` and upper bounds
`<: $U$` whereas a discussion of context bounds
`: $U$` and view bounds `<% $U$`
-is deferred to [here](#context-bounds-and-view-bounds).
+is deferred to [here](09-implicit-parameters-and-views.html#context-bounds-and-view-bounds).
The most general form of a first-order type parameter is
`$@a_1 \ldots @a_n$ $\pm$ $t$ >: $L$ <: $U$`.
@@ -467,7 +467,7 @@ The following type parameter clauses are illegal:
## Variance Annotations
Variance annotations indicate how instances of parameterized types
-vary with respect to [subtyping](#conformance). A
+vary with respect to [subtyping](05-types.html#conformance). A
‘+’ variance indicates a covariant dependency, a
‘-’ variance indicates a contravariant dependency, and a
missing variance indication indicates an invariant dependency.
@@ -510,7 +510,7 @@ changes at the following constructs.
<!-- TODO: handle type aliases -->
References to the type parameters in
-[object-private or object-protected values, types, variables, or methods](#modifiers) of the class are not
+[object-private or object-protected values, types, variables, or methods](07-classes-and-objects.html#modifiers) of the class are not
checked for their variance position. In these members the type parameter may
appear anywhere without restricting its legal variance annotations.
@@ -617,7 +617,7 @@ followed by zero or more value parameter clauses
introduces a value with a (possibly polymorphic) method type whose
parameter types and result type are as given.
-The type of the function body is expected to [conform](#expression-typing)
+The type of the function body is expected to [conform](08-expressions.html#expression-typing)
to the function's declared
result type, if one is given. If the function definition is not
recursive, the result type may be omitted, in which case it is
@@ -687,7 +687,7 @@ The by-name modifier is disallowed for parameters of classes that
carry a `val` or `var` prefix, including parameters of case
classes for which a `val` prefix is implicitly generated. The
by-name modifier is also disallowed for
-[implicit parameters](#implicit-parameters).
+[implicit parameters](09-implicit-parameters-and-views.html#implicit-parameters).
###### Example
The declaration
@@ -867,10 +867,10 @@ ImportSelector ::= id [‘=>’ id | ‘=>’ ‘_’]
```
An import clause has the form `import $p$.$I$` where $p$ is a
-[stable identifier](#paths) and $I$ is an import expression.
+[stable identifier](05-types.html#paths) and $I$ is an import expression.
The import expression determines a set of names of importable members of $p$
which are made available without qualification. A member $m$ of $p$ is
-_importable_ if it is not [object-private](#modifiers).
+_importable_ if it is not [object-private](07-classes-and-objects.html#modifiers).
The most general form of an import expression is a list of _import selectors_
```
Oops, something went wrong.

0 comments on commit e6ecfd0

Please sign in to comment.