From 83054326eb51ea73a8078a1e7feefae88107c3db Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sat, 5 May 2012 15:29:48 +0200 Subject: [Io] Día 3 --- io/coroutine.io | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 io/coroutine.io (limited to 'io/coroutine.io') 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 -- cgit v1.2.3