summaryrefslogtreecommitdiff
path: root/io/coroutine.io
diff options
context:
space:
mode:
Diffstat (limited to 'io/coroutine.io')
-rw-r--r--io/coroutine.io20
1 files changed, 20 insertions, 0 deletions
diff --git a/io/coroutine.io b/io/coroutine.io
new file mode 100644
index 0000000..8c9d743
--- /dev/null
+++ b/io/coroutine.io
@@ -0,0 +1,20 @@
+vizzini := Object clone
+vizzini talk := method(
+ "Fezzik, are there rocks ahead?" println
+ yield
+ "No more rhymes now, I mean it." println
+ yield
+)
+
+fezzik := Object clone
+fezzik rhyme := method(
+ yield
+ "If there are, we'll all be dead." println
+ yield
+ "Anybody want a peanut?" println
+)
+
+vizzini @@talk
+fezzik @@rhyme
+
+Coroutine currentCoroutine pause