summaryrefslogtreecommitdiff
path: root/test/files/run/Course-2002-10.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-01-03 15:56:13 +0000
committerMartin Odersky <odersky@gmail.com>2007-01-03 15:56:13 +0000
commita961d3dcd6f93ee006cff1d386052bf62326739a (patch)
tree5af3312932236340708522dfd078f32beed20519 /test/files/run/Course-2002-10.scala
parent02a45e20bb6f68808708dca377bc72ccaf5bba3d (diff)
downloadscala-a961d3dcd6f93ee006cff1d386052bf62326739a.tar.gz
scala-a961d3dcd6f93ee006cff1d386052bf62326739a.tar.bz2
scala-a961d3dcd6f93ee006cff1d386052bf62326739a.zip
1.
Diffstat (limited to 'test/files/run/Course-2002-10.scala')
-rw-r--r--test/files/run/Course-2002-10.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/files/run/Course-2002-10.scala b/test/files/run/Course-2002-10.scala
index 258b6dc8fd..79c760afee 100644
--- a/test/files/run/Course-2002-10.scala
+++ b/test/files/run/Course-2002-10.scala
@@ -31,9 +31,9 @@ object M1 {
Stream.cons(s.head, partialSums(s.tail) map (x => x + s.head));
def euler(s: Stream[double]): Stream[double] = {
- val nm1 = s at 0;
- val n = s at 1;
- val np1 = s at 2;
+ val nm1 = s apply 0;
+ val n = s apply 1;
+ val np1 = s apply 2;
Stream.cons(np1 - ((np1 - n)*(np1 - n) / (nm1 - 2*n + np1)),euler(s.tail))
};
@@ -68,9 +68,9 @@ object M1 {
var i = 0;
while (i < 10) {
Console.print("pi("+i+") = ");
- Console.print(str(pi0.at(i)) + ", ");
- Console.print(str(pi1.at(i)) + ", ");
- Console.print(str(pi2.at(i)) + "\n");
+ Console.print(str(pi0.apply(i)) + ", ");
+ Console.print(str(pi1.apply(i)) + ", ");
+ Console.print(str(pi2.apply(i)) + "\n");
i = i + 1;
}
Console.print("pi = ");
@@ -81,9 +81,9 @@ object M1 {
i = 0;
while (i < 10) {
Console.print("ln("+i+") = ");
- Console.print(str(ln0.at(i)) + ", ");
- Console.print(str(ln1.at(i)) + ", ");
- Console.print(str(ln2.at(i)) + "\n");
+ Console.print(str(ln0.apply(i)) + ", ");
+ Console.print(str(ln1.apply(i)) + ", ");
+ Console.print(str(ln2.apply(i)) + "\n");
i = i + 1;
}
Console.print("ln = ");