From 6eab12dda6edcc21726e771fdf32cdf3275ec9b6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 2 Jul 2004 12:18:44 +0000 Subject: *** empty log message *** --- doc/reference/ExamplesPart.tex | 6 +++--- doc/reference/ReferencePart.tex | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'doc') 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 -- cgit v1.2.3