summaryrefslogtreecommitdiff
path: root/test/pending/continuations-run/foreach.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/pending/continuations-run/foreach.scala')
-rw-r--r--test/pending/continuations-run/foreach.scala33
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