diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-11 16:55:38 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-03-11 16:55:38 +0000 |
commit | f584d243487dcd1214291167707e2f53fef5ab5e (patch) | |
tree | af3e926d301193b259d27567470b4c483efbecbe /test/pending/continuations-run/foreach.scala | |
parent | 356540e284e9c9407151a44afdb9480d8eb137a1 (diff) | |
download | scala-f584d243487dcd1214291167707e2f53fef5ab5e.tar.gz scala-f584d243487dcd1214291167707e2f53fef5ab5e.tar.bz2 scala-f584d243487dcd1214291167707e2f53fef5ab5e.zip |
moved the continuations plugin into trunk.
Diffstat (limited to 'test/pending/continuations-run/foreach.scala')
-rw-r--r-- | test/pending/continuations-run/foreach.scala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/pending/continuations-run/foreach.scala b/test/pending/continuations-run/foreach.scala new file mode 100644 index 0000000000..4daade452c --- /dev/null +++ b/test/pending/continuations-run/foreach.scala @@ -0,0 +1,33 @@ +// $Id$ + +import scala.util.continuations._ + +import scala.util.continuations.Loops._ + +object Test { + + def main(args: Array[String]): Any = { + + + reset { + + val list = List(1,2,3,4,5) + + for (x <- list.suspendable) { + + shift { k: (Unit => Unit) => + println(x) + if (x < 3) + k() + else + println("enough is enough") + } + + } + + } + + + } + +}
\ No newline at end of file |