summaryrefslogtreecommitdiff
path: root/sources/examples/futures.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-03-10 11:55:36 +0000
committerMartin Odersky <odersky@gmail.com>2003-03-10 11:55:36 +0000
commitd5da7d9aa5a8d4833775454853e81ead20cc37a7 (patch)
treed48297de81cb6c84853b94ae02b6edabee5bce5f /sources/examples/futures.scala
parent1fb5a195b5575e7015be4fd1ee8f89116a78cfb5 (diff)
downloadscala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.tar.gz
scala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.tar.bz2
scala-d5da7d9aa5a8d4833775454853e81ead20cc37a7.zip
*** empty log message ***
Diffstat (limited to 'sources/examples/futures.scala')
-rw-r--r--sources/examples/futures.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/examples/futures.scala b/sources/examples/futures.scala
new file mode 100644
index 0000000000..1e218351af
--- /dev/null
+++ b/sources/examples/futures.scala
@@ -0,0 +1,12 @@
+package examples;
+import concurrent.ops._;
+module futures {
+ def someLengthyComputation = 1;
+ def anotherLengthyComputation = 2;
+ def f(x: Int) = x + x;
+ def g(x: Int) = x * x;
+ val x = future(someLengthyComputation);
+ anotherLengthyComputation;
+ val y = f(x()) + g(x());
+ System.out.println(y);
+} \ No newline at end of file