Skip to content

Commit f16ab43

Browse files
committed
use simple quotes, fix indent, escape dollar
1 parent 5629529 commit f16ab43

File tree

5 files changed

+48
-52
lines changed

5 files changed

+48
-52
lines changed

04-identifiers-names-and-scopes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ object A {
107107
{ val x = "abc" // `x' bound by local definition
108108
import P.X._ // `x' and `y' bound by wildcard import
109109
// println("L19: "+y) // reference to `y' is ambiguous here
110-
println("L20: "+x) // `x' refers to string ``abc'' here
110+
println("L20: "+x) // `x' refers to string "abc" here
111111
}}}}}}
112112
```
113113

05-types.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -711,40 +711,39 @@ These notions are defined mutually recursively as follows.
711711

712712
1. The set of _base types_ of a type is a set of class types,
713713
given as follows.
714-
715-
- The base types of a class type $C$ with parents $T_1 , \ldots , T_n$ are
716-
$C$ itself, as well as the base types of the compound type
717-
`$T_1$ with … with $T_n$ { $R$ }`.
718-
- The base types of an aliased type are the base types of its alias.
719-
- The base types of an abstract type are the base types of its upper bound.
720-
- The base types of a parameterized type
721-
`$C$[$T_1 , \ldots , T_n$]` are the base types
722-
of type $C$, where every occurrence of a type parameter $a_i$
723-
of $C$ has been replaced by the corresponding parameter type $T_i$.
724-
- The base types of a singleton type `$p$.type` are the base types of
725-
the type of $p$.
726-
- The base types of a compound type
727-
`$T_1$ with $\ldots$ with $T_n$ { $R$ }`
728-
are the _reduced union_ of the base
729-
classes of all $T_i$'s. This means:
730-
Let the multi-set $\mathscr{S}$ be the multi-set-union of the
731-
base types of all $T_i$'s.
732-
If $\mathscr{S}$ contains several type instances of the same class, say
733-
`$S^i$#$C$[$T^i_1 , \ldots , T^i_n$]` $(i \in I)$, then
734-
all those instances
735-
are replaced by one of them which conforms to all
736-
others. It is an error if no such instance exists. It follows that the
737-
reduced union, if it exists,
738-
produces a set of class types, where different types are instances of
739-
different classes.
740-
- The base types of a type selection `$S$#$T$` are
741-
determined as follows. If $T$ is an alias or abstract type, the
742-
previous clauses apply. Otherwise, $T$ must be a (possibly
743-
parameterized) class type, which is defined in some class $B$. Then
744-
the base types of `$S$#$T$` are the base types of $T$
745-
in $B$ seen from the prefix type $S$.
746-
- The base types of an existential type `$T$ forSome { $Q$ }` are
747-
all types `$S$ forSome { $Q$ }` where $S$ is a base type of $T$.
714+
- The base types of a class type $C$ with parents $T_1 , \ldots , T_n$ are
715+
$C$ itself, as well as the base types of the compound type
716+
`$T_1$ with … with $T_n$ { $R$ }`.
717+
- The base types of an aliased type are the base types of its alias.
718+
- The base types of an abstract type are the base types of its upper bound.
719+
- The base types of a parameterized type
720+
`$C$[$T_1 , \ldots , T_n$]` are the base types
721+
of type $C$, where every occurrence of a type parameter $a_i$
722+
of $C$ has been replaced by the corresponding parameter type $T_i$.
723+
- The base types of a singleton type `$p$.type` are the base types of
724+
the type of $p$.
725+
- The base types of a compound type
726+
`$T_1$ with $\ldots$ with $T_n$ { $R$ }`
727+
are the _reduced union_ of the base
728+
classes of all $T_i$'s. This means:
729+
Let the multi-set $\mathscr{S}$ be the multi-set-union of the
730+
base types of all $T_i$'s.
731+
If $\mathscr{S}$ contains several type instances of the same class, say
732+
`$S^i$#$C$[$T^i_1 , \ldots , T^i_n$]` $(i \in I)$, then
733+
all those instances
734+
are replaced by one of them which conforms to all
735+
others. It is an error if no such instance exists. It follows that the
736+
reduced union, if it exists,
737+
produces a set of class types, where different types are instances of
738+
different classes.
739+
- The base types of a type selection `$S$#$T$` are
740+
determined as follows. If $T$ is an alias or abstract type, the
741+
previous clauses apply. Otherwise, $T$ must be a (possibly
742+
parameterized) class type, which is defined in some class $B$. Then
743+
the base types of `$S$#$T$` are the base types of $T$
744+
in $B$ seen from the prefix type $S$.
745+
- The base types of an existential type `$T$ forSome { $Q$ }` are
746+
all types `$S$ forSome { $Q$ }` where $S$ is a base type of $T$.
748747

749748
1. The notion of a type $T$ _in class $C$ seen from some prefix type $S$_
750749
makes sense only if the prefix type $S$
@@ -776,8 +775,8 @@ These notions are defined mutually recursively as follows.
776775

777776
If $T$ is a possibly parameterized class type, where $T$'s class
778777
is defined in some other class $D$, and $S$ is some prefix type,
779-
then we use ``$T$ seen from $S$'' as a shorthand for
780-
``$T$ in $D$ seen from $S$''.
778+
then we use "$T$ seen from $S$" as a shorthand for
779+
"$T$ in $D$ seen from $S$".
781780

782781
1. The _member bindings_ of a type $T$ are (1) all bindings $d$ such that
783782
there exists a type instance of some class $C$ among the base types of $T$

08-expressions.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,9 @@ discussed subsequently in decreasing order of precedence.
5151

5252
## Expression Typing
5353

54-
The typing of expressions is often relative to some _expected type_
55-
(which might be undefined).
56-
When we write ``expression $e$ is expected to conform to
57-
type $T$'', we mean: (1) the expected type of $e$ is
58-
$T$, and (2) the type of expression $e$ must conform to
59-
$T$.
54+
The typing of expressions is often relative to some _expected type_ (which might be undefined). When we write "expression $e$ is expected to conform to type $T$", we mean:
55+
1. the expected type of $e$ is $T$, and
56+
2. the type of expression $e$ must conform to $T$.
6057

6158
The following skolemization rule is applied universally for every
6259
expression: If the type of an expression would be an existential type
@@ -91,14 +88,14 @@ which refers to a special “`null`” object. This object
9188
implements methods in class `scala.AnyRef` as follows:
9289

9390
- `eq($x\,$)` and `==($x\,$)` return `true` iff the
94-
argument $x$ is also the ``null'' object.
91+
argument $x$ is also the "null" object.
9592
- `ne($x\,$)` and `!=($x\,$)` return true iff the
96-
argument x is not also the ``null'' object.
93+
argument x is not also the "null" object.
9794
- `isInstanceOf[$T\,$]` always returns `false`.
9895
- `asInstanceOf[$T\,$]` returns the [default value](06-basic-declarations-and-definitions.html#value-declarations-and-definitions) of type $T$.
9996
- `##` returns ``0``.
10097

101-
A reference to any other member of the ``null'' object causes a
98+
A reference to any other member of the "null" object causes a
10299
`NullPointerException` to be thrown.
103100

104101

@@ -1309,7 +1306,7 @@ syntax. Each of these is equivalent to the anonymous function on its right.
13091306
## Constant Expressions
13101307
13111308
Constant expressions are expressions that the Scala compiler can evaluate to a constant.
1312-
The definition of ``constant expression'' depends on the platform, but they
1309+
The definition of "constant expression" depends on the platform, but they
13131310
include at least the expressions of the following forms:
13141311
13151312
- A literal of a value class, such as an integer
@@ -1484,8 +1481,8 @@ single applicable alternative, that alternative is chosen. Otherwise, let $\math
14841481
be the set of applicable alternatives which don't employ any default argument
14851482
in the application to $e_1 , \ldots , e_m$. It is again an error if $\mathscr{CC}$ is empty.
14861483
Otherwise, one chooses the _most specific_ alternative among the alternatives
1487-
in $\mathscr{CC}$, according to the following definition of being ``as specific as'', and
1488-
``more specific than'':
1484+
in $\mathscr{CC}$, according to the following definition of being "as specific as", and
1485+
"more specific than":
14891486
14901487
<!--
14911488
question: given

10-pattern-matching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ A type pattern $T$ is of one of the following forms:
359359
Types which are not of one of the forms described above are also
360360
accepted as type patterns. However, such type patterns will be translated to their
361361
[erasure](05-types.html#type-erasure). The Scala
362-
compiler will issue an ``unchecked'' warning for these patterns to
362+
compiler will issue an "unchecked" warning for these patterns to
363363
flag the possible loss of type-safety.
364364

365365
A _type variable pattern_ is a simple identifier which starts with
@@ -492,7 +492,7 @@ top-level runtime-class of the value `x` conforms to
492492
might lead to a class cast exception later on, in the case where the
493493
list `x` contains elements other than strings. The Scala
494494
compiler will flag this potential loss of type-safety with an
495-
``unchecked'' warning message.
495+
"unchecked" warning message.
496496

497497

498498
###### Example

15-syntax-summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The lexical syntax of Scala is given by the following grammar in EBNF form:
1818

1919
```
2020
whiteSpace ::= ‘\u0020’ | ‘\u0009’ | ‘\u000D’ | ‘\u000A’
21-
upper ::= ‘A’ | … | ‘Z’ | ‘$’ | ‘_’ // and Unicode category Lu
21+
upper ::= ‘A’ | … | ‘Z’ | ‘\$’ | ‘_’ // and Unicode category Lu
2222
lower ::= ‘a’ | … | ‘z’ // and Unicode category Ll
2323
letter ::= upper | lower // and Unicode categories Lo, Lt, Nl
2424
digit ::= ‘0’ | … | ‘9’

0 commit comments

Comments
 (0)