Permalink
Browse files

github markdown: headers

  • Loading branch information...
1 parent 839fd6e commit df2f3f7cd69bb042a29b4fcea3ab81d641f17906 @adriaanm adriaanm committed Mar 10, 2014
View
@@ -1,5 +1,4 @@
-Preface
--------
+## Preface
Scala is a Java-like programming language which unifies
object-oriented and functional programming. It is a pure
View
@@ -1,5 +1,4 @@
-Lexical Syntax
-==============
+# Lexical Syntax
Scala programs are written using the Unicode Basic Multilingual Plane
(_BMP_) character set; Unicode supplementary characters are not
@@ -34,8 +33,7 @@ classes (Unicode general category given in parentheses):
\pagebreak[1]
-Identifiers
------------
+## Identifiers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
op ::= opchar {opchar}
@@ -108,8 +106,7 @@ equivalents ‘=>’ and ‘<-’, are also reserved.
work-around: `` Thread.`yield`() ``{.scala}
-Newline Characters
-------------------
+## Newline Characters
~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
semi ::= ‘;’ | nl {nl}
@@ -293,8 +290,7 @@ A single new line token is accepted
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Literals
-----------
+## Literals
There are literals for integer numbers, floating point numbers,
characters, booleans, symbols, strings. The syntax of these literals is in
@@ -549,8 +545,7 @@ identical symbol literals are equivalent with respect to reference
equality.
-Whitespace and Comments
------------------------
+## Whitespace and Comments
Tokens may be separated by whitespace characters
and/or comments. Comments come in two forms:
@@ -565,8 +560,7 @@ but are required to be properly nested. Therefore, a comment like
comment.
-XML mode
---------
+## XML mode
In order to allow literal inclusion of XML fragments, lexical analysis
switches from Scala mode to XML mode when encountering an opening
@@ -1,5 +1,4 @@
-Identifiers, Names and Scopes
-=============================
+# Identifiers, Names and Scopes
Names in Scala identify types, values, methods, and classes which are
collectively called _entities_. Names are introduced by local
View
@@ -1,5 +1,4 @@
-Types
-=====
+# Types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Type ::= FunctionArgTypes ‘=>’ Type
@@ -59,8 +58,7 @@ Type constructors are another example, as one can write
the corresponding anonymous type function directly.
-Paths
------
+## Paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Path ::= StableId
@@ -92,8 +90,7 @@ A path is one of the following.
A _stable identifier_ is a path which ends in an identifier.
-Value Types
------------
+## Value Types
Every value in Scala has a type which is of one of the following
forms.
@@ -548,8 +545,7 @@ type.
`List[java.lang.Number]`.
-Non-Value Types
----------------
+## Non-Value Types
The types explained in the following do not denote sets of values, nor
do they appear explicitly in programs. They are introduced in this
@@ -641,8 +637,7 @@ the corresponding type parameter clause.
`newType` type constructor parameter in `flatMap`.
-Base Types and Member Definitions
----------------------------------
+## Base Types and Member Definitions
Types of class members depend on the way the members are referenced.
Central here are three notions, namely:
@@ -737,8 +732,7 @@ These notions are defined mutually recursively as follows.
share a to
-Relations between types
------------------------
+## Relations between types
We define two relations between types.
@@ -939,8 +933,7 @@ A _weak least upper bound_ is a least upper bound with respect to
weak conformance.
-Volatile Types
---------------
+## Volatile Types
Type volatility approximates the possibility that a type parameter or abstract
type instance
@@ -975,8 +968,7 @@ An existential type `$T$ forSome {$\,Q\,$}` is volatile if
$T$ is volatile.
-Type Erasure
-------------
+## Type Erasure
A type is called _generic_ if it contains type arguments or type variables.
_Type erasure_ is a mapping from (possibly generic) types to
@@ -1,5 +1,4 @@
-Basic Declarations and Definitions
-==================================
+# Basic Declarations and Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
@@ -36,8 +35,7 @@ between and including $s_i$ and $s_j$,
- If $s_k$ is a value definition, it must be lazy.
-Value Declarations and Definitions
-----------------------------------
+## Value Declarations and Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Dcl ::= ‘val’ ValDcl
@@ -133,8 +131,7 @@ A value definition `val $p_1 , \ldots , p_n: T$ = $e$` is a shorthand for the
sequence of value definitions `val $p_1: T$ = $e$; ...; val $p_n: T$ = $e$`.
-Variable Declarations and Definitions
--------------------------------------
+## Variable Declarations and Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
Dcl ::= ‘var’ VarDcl
@@ -236,8 +233,7 @@ A variable definition `var $x_1 , \ldots , x_n: T$ = $e$` is a shorthand for
the sequence of variable definitions
`var $x_1: T$ = $e$; ...; var $x_n: T$ = $e$`.
-Type Declarations and Type Aliases
-----------------------------------
+## Type Declarations and Type Aliases
<!-- TODO: Higher-kinded tdecls should have a separate section -->
@@ -334,8 +330,7 @@ objects of type $S$.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Type Parameters
----------------
+## Type Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
TypeParamClause ::= ‘[’ VariantTypeParam {‘,’ VariantTypeParam} ‘]’
@@ -398,8 +393,7 @@ The above scoping restrictions are generalized to the case of nested type parame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Variance Annotations
---------------------
+## Variance Annotations
Variance annotations indicate how instances of parameterized types
vary with respect to [subtyping](#conformance). A
@@ -519,8 +513,7 @@ appear anywhere without restricting its legal variance annotations.
on which one can write only strings.
-Function Declarations and Definitions
--------------------------------------
+## Function Declarations and Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Dcl ::= ‘def’ FunDcl
@@ -768,8 +761,7 @@ as $R$ conforms to $R'$.
in `C`, even though the method is recursive.
-Import Clauses
---------------
+## Import Clauses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
Import ::= ‘import’ ImportExpr {‘,’ ImportExpr}
View
@@ -1,5 +1,4 @@
-Classes and Objects
-===================
+# Classes and Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= [`case'] `class' ClassDef
@@ -11,8 +10,7 @@ TmplDef ::= [`case'] `class' ClassDef
are both defined in terms of _templates_.
-Templates
----------
+## Templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
ClassTemplate ::= [EarlyDefs] ClassParents [TemplateBody]
@@ -485,8 +483,7 @@ before the superclass constructor of the template is called.
`"How are you, <null>"`.
-Modifiers
----------
+## Modifiers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Modifier ::= LocalModifier
@@ -676,8 +673,7 @@ the validity and meaning of a modifier are as follows.
constructor `private` (see \ref{ex:private-constr}).
-Class Definitions
------------------
+## Class Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= `class' ClassDef
@@ -853,8 +849,7 @@ primary constructor of the class).
third one constructs a list with a given head and tail.
-Case Classes
-------------
+## Case Classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= `case' `class' ClassDef
@@ -1090,8 +1085,7 @@ least proper supertype (which is statically known).
in `MyTable`.
-Object Definitions
-------------------
+## Object Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
ObjectDef ::= id ClassTemplate
Oops, something went wrong.

0 comments on commit df2f3f7

Please sign in to comment.