diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2005-12-16 18:44:33 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2005-12-16 18:44:33 +0000 |
commit | 53a3cc7b17f4cf97075b7e71720777fd84109696 (patch) | |
tree | 0cc784e0b47ea49cc151a136d19f20bfa8ee2197 /docs/examples/futures.scala | |
parent | df50e05006b43b007c2587549030d24b5c154398 (diff) | |
download | scala-53a3cc7b17f4cf97075b7e71720777fd84109696.tar.gz scala-53a3cc7b17f4cf97075b7e71720777fd84109696.tar.bz2 scala-53a3cc7b17f4cf97075b7e71720777fd84109696.zip |
Created proper 'docs' folder for new layout.
Diffstat (limited to 'docs/examples/futures.scala')
-rw-r--r-- | docs/examples/futures.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/examples/futures.scala b/docs/examples/futures.scala new file mode 100644 index 0000000000..905d360612 --- /dev/null +++ b/docs/examples/futures.scala @@ -0,0 +1,17 @@ +package examples; + +import concurrent.ops._; + +object futures { + def someLengthyComputation = 1; + def anotherLengthyComputation = 2; + def f(x: Int) = x + x; + def g(x: Int) = x * x; + + 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 |