From bb2a952bc7593e26a312491a2564525b0b5397e9 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 28 Mar 2014 21:55:47 -0700 Subject: Reducing overlap of code and math. Prefer smaller islands of `code` in bigger sections of $math$. Do not include $`code` in math$, and avoid `$math$ in code`. --- spec/03-types.md | 69 +++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) (limited to 'spec/03-types.md') diff --git a/spec/03-types.md b/spec/03-types.md index c765a76812..a1ab025abe 100644 --- a/spec/03-types.md +++ b/spec/03-types.md @@ -81,16 +81,16 @@ and in that function form a central role in Scala's type system. A path is one of the following. - The empty path ε (which cannot be written explicitly in user programs). -- `$C$.this`, where $C$ references a class. - The path `this` is taken as a shorthand for `$C$.this` where +- $C.$`this`, where $C$ references a class. + The path `this` is taken as a shorthand for $C.$`this` where $C$ is the name of the class directly enclosing the reference. -- `$p$.$x$` where $p$ is a path and $x$ is a stable member of $p$. +- $p.x$ where $p$ is a path and $x$ is a stable member of $p$. _Stable members_ are packages or members introduced by object definitions or by value definitions of [non-volatile types](#volatile-types). -- `$C$.super.$x$` or `$C$.super[$M$].$x$` +- $C.$`super`$.x$ or $C.$`super`$[M].x$ where $C$ references a class and $x$ references a stable member of the super class or designated parent class $M$ of $C$. - The prefix `super` is taken as a shorthand for `$C$.super` where + The prefix `super` is taken as a shorthand for $C.$`super` where $C$ is the name of the class directly enclosing the reference. A _stable identifier_ is a path which ends in an identifier. @@ -107,7 +107,7 @@ forms. SimpleType ::= Path ‘.’ type ``` -A singleton type is of the form `$p$.type`, where $p$ is a +A singleton type is of the form $p.$`type`, where $p$ is a path pointing to a value expected to [conform](06-expressions.html#expression-typing) to `scala.AnyRef`. The type denotes the set of values consisting of `null` and the value denoted by $p$. @@ -121,7 +121,7 @@ declared to be a subtype of trait `scala.Singleton`. SimpleType ::= SimpleType ‘#’ id ``` -A type projection `$T$#$x$` references the type member named +A type projection $T$#$x$ references the type member named $x$ of type $T$.