summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-05-27 12:34:32 +0000
committermichelou <michelou@epfl.ch>2005-05-27 12:34:32 +0000
commit8c6e72f8ea83c5942d102ac3be29edc3d1e6d644 (patch)
tree33700e67f4125de1c78a7834275a40ace5698860 /doc
parent3371e4627e0eed75b1af852e6ea4dcec31112ac1 (diff)
downloadscala-8c6e72f8ea83c5942d102ac3be29edc3d1e6d644.tar.gz
scala-8c6e72f8ea83c5942d102ac3be29edc3d1e6d644.tar.bz2
scala-8c6e72f8ea83c5942d102ac3be29edc3d1e6d644.zip
- updated list of keywords.
- changed 'e.match' to 'e match'.
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/ReferencePart.tex25
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/reference/ReferencePart.tex b/doc/reference/ReferencePart.tex
index 13b3504208..ec62089df1 100644
--- a/doc/reference/ReferencePart.tex
+++ b/doc/reference/ReferencePart.tex
@@ -96,11 +96,12 @@ syntactic class \code{id} of lexical identifiers.
\begin{lstlisting}
abstract case catch class def
do else extends false final
-finally for if import new
-null object override package private
-protected return sealed super this
-throw trait try true type
-val var while with yield
+finally for if implicit import
+match new null object override
+package private protected return sealed
+super this throw trait try
+true type val var while
+with yield
_ : = => <- <: >: # @
\end{lstlisting}
@@ -1014,7 +1015,7 @@ value definition ~\lstinline@val $p$ = $e$@~ is expanded as follows:
1. If the pattern $p$ has bound variables $x_1 \commadots x_n$, where $n > 1$:
\begin{lstlisting}
-val $\Dollar x$ = $e$.match {case $p$ => scala.Tuple$n$($x_1 \commadots x_n$)}
+val $\Dollar x$ = $e$ match {case $p$ => scala.Tuple$n$($x_1 \commadots x_n$)}
val $x_1$ = $\Dollar x$._1
$\ldots$
val $x_n$ = $\Dollar x$._n .
@@ -1025,12 +1026,12 @@ Here, $\Dollar x$ is a fresh name. The class
2. If $p$ has a unique bound variable $x$:
\begin{lstlisting}
-val $x$ = $e$.match { case $p$ => $x$ }
+val $x$ = $e$ match { case $p$ => $x$ }
\end{lstlisting}
3. If $p$ has no bound variables:
\begin{lstlisting}
-$e$.match { case $p$ => ()}
+$e$ match { case $p$ => ()}
\end{lstlisting}
\example
@@ -1044,9 +1045,9 @@ val x :: xs = mylist; // an infix pattern definition
The last two definitions have the following expansions.
\begin{lstlisting}
-val x = f().match { case Some(x) => x }
+val x = f() match { case Some(x) => x }
-val x$\Dollar$ = mylist.match { case x :: xs => scala.Tuple2(x, xs) }
+val x$\Dollar$ = mylist match { case x :: xs => scala.Tuple2(x, xs) }
val x = x$\Dollar$._1;
val xs = x$\Dollar$._2;
\end{lstlisting}
@@ -4439,13 +4440,13 @@ abstract class Any {
def toString(): String = $\ldots$
/** Type test */
- def isInstanceOf[a]: Boolean = match {
+ def isInstanceOf[a]: Boolean = this match {
case x: a => true
case _ => false
}
/** Type cast */
- def asInstanceOf[a]: a = match {
+ def asInstanceOf[a]: a = this match {
case x: a => x
case _ => if (this eq null) this
else throw new ClassCastException()