Skip to content

Commit 34bbd14

Browse files
committed
Editorial: Italicized more defining occurrences of terms.
1 parent ebc7f8f commit 34bbd14

File tree

7 files changed

+54
-54
lines changed

7 files changed

+54
-54
lines changed

spec/03-types.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ forms.
105105
SimpleType ::= Path ‘.’ type
106106
```
107107

108-
A singleton type is of the form $p.$`type`, where $p$ is a
108+
A _singleton type_ is of the form $p.$`type`, where $p$ is a
109109
path pointing to a value expected to [conform](06-expressions.html#expression-typing)
110110
to `scala.AnyRef`. The type denotes the set of values
111111
consisting of `null` and the value denoted by $p$.
@@ -119,7 +119,7 @@ declared to be a subtype of trait `scala.Singleton`.
119119
SimpleType ::= SimpleType ‘#’ id
120120
```
121121

122-
A type projection $T$#$x$ references the type member named
122+
A _type projection_ $T$#$x$ references the type member named
123123
$x$ of type $T$.
124124

125125
<!--
@@ -134,7 +134,7 @@ If $x$ references an abstract type member, then $T$ must be a
134134
SimpleType ::= StableId
135135
```
136136

137-
A type designator refers to a named value type. It can be simple or
137+
A _type designator_ refers to a named value type. It can be simple or
138138
qualified. All such type designators are shorthands for type projections.
139139

140140
Specifically, the unqualified type name $t$ where $t$ is bound in some
@@ -167,7 +167,7 @@ SimpleType ::= SimpleType TypeArgs
167167
TypeArgs ::= ‘[’ Types ‘]’
168168
```
169169

170-
A parameterized type $T[ T_1 , \ldots , T_n ]$ consists of a type
170+
A _parameterized type_ $T[ T_1 , \ldots , T_n ]$ consists of a type
171171
designator $T$ and type parameters $T_1 , \ldots , T_n$ where
172172
$n \geq 1$. $T$ must refer to a type constructor which takes $n$ type
173173
parameters $a_1 , \ldots , a_n$.
@@ -227,7 +227,7 @@ G[S, Int] // illegal: S constrains its parameter to
227227
SimpleType ::= ‘(’ Types ‘)’
228228
```
229229

230-
A tuple type $(T_1 , \ldots , T_n)$ is an alias for the
230+
A _tuple type_ $(T_1 , \ldots , T_n)$ is an alias for the
231231
class `scala.Tuple$n$[$T_1$, … , $T_n$]`, where $n \geq 2$.
232232

233233
Tuple classes are case classes whose fields can be accessed using
@@ -255,7 +255,7 @@ trait Product_n[+$T_1$, … , +$T_n$] {
255255
AnnotType ::= SimpleType {Annotation}
256256
```
257257

258-
An annotated type $T$ $a_1, \ldots, a_n$
258+
An _annotated type_ $T$ $a_1, \ldots, a_n$
259259
attaches [annotations](11-annotations.html#user-defined-annotations)
260260
$a_1 , \ldots , a_n$ to the type $T$.
261261

@@ -278,7 +278,7 @@ RefineStat ::= Dcl
278278
|
279279
```
280280

281-
A compound type $T_1$ `with``with` $T_n \\{ R \\}$
281+
A _compound type_ $T_1$ `with``with` $T_n \\{ R \\}$
282282
represents objects with members as given in the component types
283283
$T_1 , \ldots , T_n$ and the refinement $\\{ R \\}$. A refinement
284284
$\\{ R \\}$ contains declarations and type definitions.
@@ -343,7 +343,7 @@ a value `callsign` and a `fly` method.
343343
InfixType ::= CompoundType {id [nl] CompoundType}
344344
```
345345

346-
An infix type $T_1$ `op` $T_2$ consists of an infix
346+
An _infix type_ $T_1$ `op` $T_2$ consists of an infix
347347
operator `op` which gets applied to two type operands $T_1$ and
348348
$T_2$. The type is equivalent to the type application
349349
`op`$[T_1, T_2]$. The infix operator `op` may be an
@@ -410,7 +410,7 @@ ExistentialDcl ::= ‘type’ TypeDcl
410410
| ‘val’ ValDcl
411411
```
412412

413-
An existential type has the form `$T$ forSome { $Q$ }`
413+
An _existential type_ has the form `$T$ forSome { $Q$ }`
414414
where $Q$ is a sequence of
415415
[type declarations](04-basic-declarations-and-definitions.html#type-declarations-and-type-aliases).
416416

@@ -564,7 +564,7 @@ report as the internal types of defined identifiers.
564564

565565
### Method Types
566566

567-
A method type is denoted internally as $(\mathit{Ps})U$, where $(\mathit{Ps})$
567+
A _method type_ is denoted internally as $(\mathit{Ps})U$, where $(\mathit{Ps})$
568568
is a sequence of parameter names and types $(p_1:T_1 , \ldots , p_n:T_n)$
569569
for some $n \geq 0$ and $U$ is a (value or method) type. This type
570570
represents named methods that take arguments named $p_1 , \ldots , p_n$
@@ -631,7 +631,7 @@ union : [A >: Nothing <: Comparable[A]] (x: Set[A], xs: Set[A]) Set[A]
631631

632632
### Type Constructors
633633

634-
A type constructor is represented internally much like a polymorphic method type.
634+
A _type constructor_ is represented internally much like a polymorphic method type.
635635
`[$\pm$ $a_1$ >: $L_1$ <: $U_1 , \ldots , \pm a_n$ >: $L_n$ <: $U_n$] $T$`
636636
represents a type that is expected by a
637637
[type constructor parameter](04-basic-declarations-and-definitions.html#type-parameters) or an

spec/04-basic-declarations-and-definitions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,9 @@ ParamType ::= Type
595595
| Type ‘*’
596596
```
597597

598-
A function declaration has the form `def $f\,\mathit{psig}$: $T$`, where
598+
A _function declaration_ has the form `def $f\,\mathit{psig}$: $T$`, where
599599
$f$ is the function's name, $\mathit{psig}$ is its parameter
600-
signature and $T$ is its result type. A function definition
600+
signature and $T$ is its result type. A _function definition_
601601
`def $f\,\mathit{psig}$: $T$ = $e$` also includes a _function body_ $e$,
602602
i.e. an expression which defines the function's result. A parameter
603603
signature consists of an optional type parameter clause `[$\mathit{tps}\,$]`,
@@ -612,13 +612,13 @@ result type, if one is given. If the function definition is not
612612
recursive, the result type may be omitted, in which case it is
613613
determined from the packed type of the function body.
614614

615-
A type parameter clause $\mathit{tps}$ consists of one or more
615+
A _type parameter clause_ $\mathit{tps}$ consists of one or more
616616
[type declarations](#type-declarations-and-type-aliases), which introduce type
617617
parameters, possibly with bounds. The scope of a type parameter includes
618618
the whole signature, including any of the type parameter bounds as
619619
well as the function body, if it is present.
620620

621-
A value parameter clause $\mathit{ps}$ consists of zero or more formal
621+
A _value parameter clause_ $\mathit{ps}$ consists of zero or more formal
622622
parameter bindings such as `$x$: $T$` or `$x: T = e$`, which bind value
623623
parameters and associate them with their types.
624624

@@ -774,12 +774,12 @@ FunDef ::= FunSig [nl] ‘{’ Block ‘}’
774774

775775
Special syntax exists for procedures, i.e. functions that return the
776776
`Unit` value `()`.
777-
A procedure declaration is a function declaration where the result type
777+
A _procedure declaration_ is a function declaration where the result type
778778
is omitted. The result type is then implicitly completed to the
779779
`Unit` type. E.g., `def $f$($\mathit{ps}$)` is equivalent to
780780
`def $f$($\mathit{ps}$): Unit`.
781781

782-
A procedure definition is a function definition where the result type
782+
A _procedure definition_ is a function definition where the result type
783783
and the equals sign are omitted; its defining expression must be a block.
784784
E.g., `def $f$($\mathit{ps}$) {$\mathit{stats}$}` is equivalent to
785785
`def $f$($\mathit{ps}$): Unit = {$\mathit{stats}$}`.

spec/05-classes-and-objects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SelfType ::= id [`:' Type] `=>'
2727
| this `:' Type `=>'
2828
```
2929

30-
A template defines the type signature, behavior and initial state of a
30+
A _template_ defines the type signature, behavior and initial state of a
3131
trait or class of objects or of a single object. Templates form part of
3232
instance creation expressions, class definitions, and object
3333
definitions. A template
@@ -972,7 +972,7 @@ TraitDef ::= id [TypeParamClause] TraitTemplateOpt
972972
TraitTemplateOpt ::= `extends' TraitTemplate | [[`extends'] TemplateBody]
973973
```
974974

975-
A trait is a class that is meant to be added to some other class
975+
A _trait_ is a class that is meant to be added to some other class
976976
as a mixin. Unlike normal classes, traits cannot have
977977
constructor parameters. Furthermore, no constructor arguments are
978978
passed to the superclass of the trait. This is not necessary as traits are
@@ -1074,7 +1074,7 @@ in `MyTable`.
10741074
ObjectDef ::= id ClassTemplate
10751075
```
10761076

1077-
An object definition defines a single object of a new class. Its
1077+
An _object definition_ defines a single object of a new class. Its
10781078
most general form is
10791079
`object $m$ extends $t$`. Here,
10801080
$m$ is the name of the object to be defined, and

spec/06-expressions.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ because otherwise the underscore would be considered part of the name.
454454
SimpleExpr ::= SimpleExpr TypeArgs
455455
```
456456

457-
A type application `$e$[$T_1 , \ldots , T_n$]` instantiates
457+
A _type application_ `$e$[$T_1 , \ldots , T_n$]` instantiates
458458
a polymorphic value $e$ of type
459459
`[$a_1$ >: $L_1$ <: $U_1, \ldots , a_n$ >: $L_n$ <: $U_n$]$S$`
460460
with argument types
@@ -480,7 +480,7 @@ and the expected result type.
480480
SimpleExpr ::= `(' [Exprs] `)'
481481
```
482482

483-
A tuple expression `($e_1 , \ldots , e_n$)` is an alias
483+
A _tuple expression_ `($e_1 , \ldots , e_n$)` is an alias
484484
for the class instance creation
485485
`scala.Tuple$n$($e_1 , \ldots , e_n$)`, where $n \geq 2$.
486486
The empty tuple
@@ -492,7 +492,7 @@ The empty tuple
492492
SimpleExpr ::= `new' (ClassTemplate | TemplateBody)
493493
```
494494

495-
A simple instance creation expression is of the form
495+
A _simple instance creation expression_ is of the form
496496
`new $c$`
497497
where $c$ is a [constructor invocation](05-classes-and-objects.html#constructor-invocations). Let $T$ be
498498
the type of $c$. Then $T$ must
@@ -515,7 +515,7 @@ The expression is evaluated by creating a fresh
515515
object of type $T$ which is initialized by evaluating $c$. The
516516
type of the expression is $T$.
517517

518-
A general instance creation expression is of the form
518+
A _general instance creation expression_ is of the form
519519
`new $t$` for some [class template](05-classes-and-objects.html#templates) $t$.
520520
Such an expression is equivalent to the block
521521

@@ -560,7 +560,7 @@ BlockExpr ::= ‘{’ CaseClauses ‘}’
560560
Block ::= BlockStat {semi BlockStat} [ResultExpr]
561561
```
562562

563-
A block expression `{$s_1$; $\ldots$; $s_n$; $e\,$}` is
563+
A _block expression_ `{$s_1$; $\ldots$; $s_n$; $e\,$}` is
564564
constructed from a sequence of block statements $s_1 , \ldots , s_n$
565565
and a final expression $e$. The statement sequence may not contain
566566
two definitions or declarations that bind the same name in the same
@@ -715,7 +715,7 @@ name.
715715

716716
### Assignment Operators
717717

718-
An assignment operator is an operator symbol (syntax category
718+
An _assignment operator_ is an operator symbol (syntax category
719719
`op` in [Identifiers](01-lexical-syntax.html#identifiers)) that ends in an equals character
720720
`=`”, with the exception of operators for which one of
721721
the following conditions holds:
@@ -754,7 +754,7 @@ The re-interpretation occurs if the following two conditions are fulfilled.
754754
Expr1 ::= PostfixExpr `:' CompoundType
755755
```
756756

757-
The typed expression $e: T$ has type $T$. The type of
757+
The _typed expression_ $e: T$ has type $T$. The type of
758758
expression $e$ is expected to conform to $T$. The result of
759759
the expression is the value of $e$ converted to type $T$.
760760

@@ -773,7 +773,7 @@ Here are examples of well-typed and ill-typed expressions.
773773
Expr1 ::= PostfixExpr `:' Annotation {Annotation}
774774
```
775775

776-
An annotated expression `$e$: @$a_1$ $\ldots$ @$a_n$`
776+
An _annotated expression_ `$e$: @$a_1$ $\ldots$ @$a_n$`
777777
attaches [annotations](11-annotations.html#user-defined-annotations) $a_1 , \ldots , a_n$ to the
778778
expression $e$.
779779

@@ -868,7 +868,7 @@ def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = {
868868
Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] `else' Expr]
869869
```
870870

871-
The conditional expression `if ($e_1$) $e_2$ else $e_3$` chooses
871+
The _conditional expression_ `if ($e_1$) $e_2$ else $e_3$` chooses
872872
one of the values of $e_2$ and $e_3$, depending on the
873873
value of $e_1$. The condition $e_1$ is expected to
874874
conform to type `Boolean`. The then-part $e_2$ and the
@@ -894,7 +894,7 @@ evaluated as if it was `if ($e_1$) $e_2$ else ()`.
894894
Expr1 ::= `while' `(' Expr ')' {nl} Expr
895895
```
896896

897-
The while loop expression `while ($e_1$) $e_2$` is typed and
897+
The _while loop expression_ `while ($e_1$) $e_2$` is typed and
898898
evaluated as if it was an application of `whileLoop ($e_1$) ($e_2$)` where
899899
the hypothetical function `whileLoop` is defined as follows.
900900

@@ -909,7 +909,7 @@ def whileLoop(cond: => Boolean)(body: => Unit): Unit =
909909
Expr1 ::= `do' Expr [semi] `while' `(' Expr ')'
910910
```
911911

912-
The do loop expression `do $e_1$ while ($e_2$)` is typed and
912+
The _do loop expression_ `do $e_1$ while ($e_2$)` is typed and
913913
evaluated as if it was the expression `($e_1$ ; while ($e_2$) $e_1$)`.
914914
A semicolon preceding the `while` symbol of a do loop expression is ignored.
915915

@@ -923,9 +923,9 @@ Generator ::= Pattern1 `<-' Expr {[semi] Guard | semi Pattern1 `=' Expr}
923923
Guard ::= `if' PostfixExpr
924924
```
925925

926-
A for loop `for ($\mathit{enums}\,$) $e$` executes expression $e$
927-
for each binding generated by the enumerators $\mathit{enums}$. A for
928-
comprehension `for ($\mathit{enums}\,$) yield $e$` evaluates
926+
A _for loop_ `for ($\mathit{enums}\,$) $e$` executes expression $e$
927+
for each binding generated by the enumerators $\mathit{enums}$.
928+
A _for comprehension_ `for ($\mathit{enums}\,$) yield $e$` evaluates
929929
expression $e$ for each binding generated by the enumerators $\mathit{enums}$
930930
and collects the results. An enumerator sequence always starts with a
931931
generator; this can be followed by further generators, value
@@ -1067,7 +1067,7 @@ The code above makes use of the fact that `map`, `flatMap`,
10671067
Expr1 ::= `return' [Expr]
10681068
```
10691069

1070-
A return expression `return $e$` must occur inside the body of some
1070+
A _return expression_ `return $e$` must occur inside the body of some
10711071
enclosing named method or function. The innermost enclosing named
10721072
method or function in a source program, $f$, must have an explicitly declared result type,
10731073
and the type of $e$ must conform to it.
@@ -1104,7 +1104,7 @@ and will propagate up the call stack.
11041104
Expr1 ::= `throw' Expr
11051105
```
11061106

1107-
A throw expression `throw $e$` evaluates the expression
1107+
A _throw expression_ `throw $e$` evaluates the expression
11081108
$e$. The type of this expression must conform to
11091109
`Throwable`. If $e$ evaluates to an exception
11101110
reference, evaluation is aborted with the thrown exception. If $e$
@@ -1122,7 +1122,7 @@ Expr1 ::= `try' (`{' Block `}' | Expr) [`catch' `{' CaseClauses `}']
11221122
[`finally' Expr]
11231123
```
11241124

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

@@ -1311,7 +1311,7 @@ TemplateStat ::= Import
13111311
|
13121312
```
13131313

1314-
Statements occur as parts of blocks and templates. A statement can be
1314+
Statements occur as parts of blocks and templates. A _statement_ can be
13151315
an import, a definition or an expression, or it can be empty.
13161316
Statements used in the template of a class definition can also be
13171317
declarations. An expression that is used as a statement can have an

spec/07-implicits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object Monoids {
4444

4545
## Implicit Parameters
4646

47-
An implicit parameter list
47+
An _implicit parameter list_
4848
`(implicit $p_1$,$\ldots$,$p_n$)` of a method marks the parameters $p_1 , \ldots , p_n$ as
4949
implicit. A method or constructor can have only one implicit parameter
5050
list, and it must be the last parameter list given.

0 commit comments

Comments
 (0)