summaryrefslogtreecommitdiff
path: root/sources/examples/futures.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sources/examples/futures.scala')
-rw-r--r--sources/examples/futures.scala15
1 files changed, 10 insertions, 5 deletions
diff --git a/sources/examples/futures.scala b/sources/examples/futures.scala
index 1e218351af..905d360612 100644
--- a/sources/examples/futures.scala
+++ b/sources/examples/futures.scala
@@ -1,12 +1,17 @@
package examples;
+
import concurrent.ops._;
-module futures {
+
+object 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);
+
+ def main(args: Array[String]): Unit = {
+ val x = future(someLengthyComputation);
+ anotherLengthyComputation;
+ val y = f(x()) + g(x());
+ Console.println(y)
+ }
} \ No newline at end of file