From ea4a4fd3b2dbd95551d7925ec7d118ccd56420cb Mon Sep 17 00:00:00 2001 From: michelou Date: Wed, 27 Jul 2005 12:26:21 +0000 Subject: - updated code for deprecated def-parameters. --- doc/reference/ExamplesPart.tex | 2 +- doc/reference/ReferencePart.tex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/reference/ExamplesPart.tex b/doc/reference/ExamplesPart.tex index c23bf4a9b5..66dd72486b 100644 --- a/doc/reference/ExamplesPart.tex +++ b/doc/reference/ExamplesPart.tex @@ -4482,7 +4482,7 @@ command need to be passed by-name, so that they are evaluated repeatedly for each loop iteration. This leads to the following definition of \code{whileLoop}. \begin{lstlisting} -def whileLoop(def condition: boolean)(def command: unit): unit = +def whileLoop(condition: => boolean)(command: => unit): unit = if (condition) { command; whileLoop(condition)(command) } else {} diff --git a/doc/reference/ReferencePart.tex b/doc/reference/ReferencePart.tex index ec62089df1..0887f72917 100644 --- a/doc/reference/ReferencePart.tex +++ b/doc/reference/ReferencePart.tex @@ -3180,8 +3180,8 @@ evaluated as if it was an application of ~\lstinline@whileLoop ($e_1$) ($e_2$)@~ the hypothetical function \code{whileLoop} is defined as follows. \begin{lstlisting} - def whileLoop(def c: boolean)(def s: unit): unit = - if (c) { s ; while(c)(s) } else {} + def whileLoop(cond: => Boolean)(body: => Unit): Unit = + if (cond) { body ; while(cond)(body) } else {} \end{lstlisting} \example The loop -- cgit v1.2.3