From ca9f4fbb7b1212cfcde866ee95957afc6d157943 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 11 Jul 2003 13:02:40 +0000 Subject: *** empty log message *** --- test/files/pos/cours2c.scala | 6 +++--- test/files/pos/exceptions.scala | 5 ++--- test/files/run/Course-2002-08.scala | 6 +++--- test/files/run/Course-2002-13.scala | 4 ++-- test/files/run/mics1.scala | 2 +- test/files/run/queens.scala | 4 ++-- test/pos/cours2c.scala | 6 +++--- test/pos/exceptions.scala | 5 ++--- 8 files changed, 18 insertions(+), 20 deletions(-) (limited to 'test') diff --git a/test/files/pos/cours2c.scala b/test/files/pos/cours2c.scala index 776469e1bb..e3917e43eb 100644 --- a/test/files/pos/cours2c.scala +++ b/test/files/pos/cours2c.scala @@ -32,12 +32,12 @@ object m2 { def average(x: Double, y: Double) = (x + y)/2; def fixedPoint(f: Double => Double, firstGuess: Double) = { - def try(guess: Double): Double = { + def Try(guess: Double): Double = { val next = f(guess); if (isCloseEnough(guess, next)) next - else try(next) + else Try(next) } - try(firstGuess); + Try(firstGuess); } def sin(x: Double): Double = x; diff --git a/test/files/pos/exceptions.scala b/test/files/pos/exceptions.scala index c47b0e4785..f28a10d367 100644 --- a/test/files/pos/exceptions.scala +++ b/test/files/pos/exceptions.scala @@ -4,7 +4,7 @@ object test { //def error[a](x: String):a = new java.lang.RuntimeException(x) throw; - def main(): Unit = { + def main(args: Array[String]): Unit = { try { try { System.out.println("hi!"); @@ -12,11 +12,10 @@ object test { } finally { System.out.println("ho!") } - } except { + } catch { case ex: IOException => System.out.println("io exception!"); case ex => System.out.println(ex); } } - main(); } diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala index b821caa140..f94b42ebc0 100644 --- a/test/files/run/Course-2002-08.scala +++ b/test/files/run/Course-2002-08.scala @@ -89,16 +89,16 @@ object M1 { object M2 { - def while(def condition: Boolean)(def command: Unit): Unit = + def While(def condition: Boolean)(def command: Unit): Unit = if (condition) { - command; while(condition)(command) + command; While(condition)(command) } else { } def power (x: Double, exp: Int): Double = { var r = 1.0; var i = exp; - while (i > 0) { r = r * x; i = i - 1 } + While (i > 0) { r = r * x; i = i - 1 } r } diff --git a/test/files/run/Course-2002-13.scala b/test/files/run/Course-2002-13.scala index ebdde8bf86..541008bb1b 100644 --- a/test/files/run/Course-2002-13.scala +++ b/test/files/run/Course-2002-13.scala @@ -50,14 +50,14 @@ class Interpreter { } } loop; - } except ({ + } catch { case (exception: FileNotFoundException) => System.out.println("not found: " + filename); ""; case (exception: IOException) => System.out.println("can't read: " + filename); ""; - }) + } } def run(prompt: String)(process: String => Unit): Unit = { diff --git a/test/files/run/mics1.scala b/test/files/run/mics1.scala index 8d5cecf043..b3673dd5e0 100644 --- a/test/files/run/mics1.scala +++ b/test/files/run/mics1.scala @@ -16,7 +16,7 @@ object Test { System.out.print("lookup(" + key + ") = "); try { System.out.println(map.lookup(key)); - } except { + } catch { case e => System.out.println(e.getMessage()); } } diff --git a/test/files/run/queens.scala b/test/files/run/queens.scala index 4daa702e29..ba812f5971 100644 --- a/test/files/run/queens.scala +++ b/test/files/run/queens.scala @@ -21,11 +21,11 @@ object M0 { abs(col - p.head) != delta && isSafe(col, p.tail, delta + 1)); - for { + for ( val placement <- placeQueens(row - 1); val col <- columns; isSafe(col, placement, 1) - } yield { + ) yield { col :: placement } } diff --git a/test/pos/cours2c.scala b/test/pos/cours2c.scala index 776469e1bb..e3917e43eb 100644 --- a/test/pos/cours2c.scala +++ b/test/pos/cours2c.scala @@ -32,12 +32,12 @@ object m2 { def average(x: Double, y: Double) = (x + y)/2; def fixedPoint(f: Double => Double, firstGuess: Double) = { - def try(guess: Double): Double = { + def Try(guess: Double): Double = { val next = f(guess); if (isCloseEnough(guess, next)) next - else try(next) + else Try(next) } - try(firstGuess); + Try(firstGuess); } def sin(x: Double): Double = x; diff --git a/test/pos/exceptions.scala b/test/pos/exceptions.scala index c47b0e4785..f28a10d367 100644 --- a/test/pos/exceptions.scala +++ b/test/pos/exceptions.scala @@ -4,7 +4,7 @@ object test { //def error[a](x: String):a = new java.lang.RuntimeException(x) throw; - def main(): Unit = { + def main(args: Array[String]): Unit = { try { try { System.out.println("hi!"); @@ -12,11 +12,10 @@ object test { } finally { System.out.println("ho!") } - } except { + } catch { case ex: IOException => System.out.println("io exception!"); case ex => System.out.println(ex); } } - main(); } -- cgit v1.2.3