diff options
author | Martin Odersky <odersky@gmail.com> | 2004-07-02 12:18:44 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2004-07-02 12:18:44 +0000 |
commit | 6eab12dda6edcc21726e771fdf32cdf3275ec9b6 (patch) | |
tree | 337ab8943510d8615042c1c601496cdc9b224967 /doc | |
parent | 45541e41cb9a6d456902240898e3efb9661d4372 (diff) | |
download | scala-6eab12dda6edcc21726e771fdf32cdf3275ec9b6.tar.gz scala-6eab12dda6edcc21726e771fdf32cdf3275ec9b6.tar.bz2 scala-6eab12dda6edcc21726e771fdf32cdf3275ec9b6.zip |
*** empty log message ***
Diffstat (limited to 'doc')
-rw-r--r-- | doc/reference/ExamplesPart.tex | 6 | ||||
-rw-r--r-- | doc/reference/ReferencePart.tex | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/reference/ExamplesPart.tex b/doc/reference/ExamplesPart.tex index a335b1d739..f6bcd5d595 100644 --- a/doc/reference/ExamplesPart.tex +++ b/doc/reference/ExamplesPart.tex @@ -833,7 +833,7 @@ two given numbers \code{a} and \code{b}: \begin{lstlisting} def powerOfTwo(x: int): int = if (x == 0) 1 else x * powerOfTwo(x - 1); def sumPowersOfTwo(a: int, b: int): int = - if (a > b) 0 else powerOfTwo(x) + sumPowersOfTwo(a + 1, b) + if (a > b) 0 else powerOfTwo(a) + sumPowersOfTwo(a + 1, b) \end{lstlisting} \end{enumerate} These functions are all instances of @@ -1438,10 +1438,10 @@ method is invoked by simply mentioning its name. \begin{lstlisting} class Rational(n: int, d: int) extends AnyRef { ... // as before - def square = Rational(numer*numer, denom*denom); + def square = new Rational(numer*numer, denom*denom); } val r = new Rational(3,4); -System.out.println(r.square); // prints``9/16'' +System.out.println(r.square); // prints``9/16''* \end{lstlisting} That is, parameterless methods are accessed just as value fields such as \code{numer} are. The difference between values and parameterless diff --git a/doc/reference/ReferencePart.tex b/doc/reference/ReferencePart.tex index 4c29bd1a74..79b4cdf146 100644 --- a/doc/reference/ReferencePart.tex +++ b/doc/reference/ReferencePart.tex @@ -513,12 +513,12 @@ c: (Int) (String, String) String A polymorphic method type is denoted internally as ~\lstinline@[$\tps\,$]$T$@~ where \lstinline@[$\tps\,$]@ is a type parameter section -~\lstinline@[$a_1$ <: $L_1$ >: $U_1 \commadots a_n$ <: $L_n$ >: $U_n$]@~ +~\lstinline@[$a_1$ >: $L_1$ <: $U_1 \commadots a_n$ >: $L_n$ <: $U_n$]@~ for some $n \geq 0$ and $T$ is a (value or method) type. This type represents named methods that take type arguments ~\lstinline@$S_1 \commadots S_n$@~ which conform (\sref{sec:param-types}) to the lower bounds -~\lstinline@$S_1 \commadots S_n$@~ and the upper bounds +~\lstinline@$L_1 \commadots L_n$@~ and the upper bounds ~\lstinline@$U_1 \commadots U_n$@~ and that yield results of type $T$. \example The declarations |