summaryrefslogtreecommitdiff
path: root/2d/agenda.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-10-06 08:17:04 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-10-06 08:17:04 -0400
commit22a23a79d9325f8f7ba963fae706bca46de2a491 (patch)
tree0152e12acaec16e95e55d72909a57bda364fc7d2 /2d/agenda.scm
parentd71e246ccdba27b22749c33bd5daad28b3a763e2 (diff)
Move wait procedure into agenda module.
Diffstat (limited to '2d/agenda.scm')
-rw-r--r--2d/agenda.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/2d/agenda.scm b/2d/agenda.scm
index 77983b2..c336ff1 100644
--- a/2d/agenda.scm
+++ b/2d/agenda.scm
@@ -25,12 +25,14 @@
#:use-module (ice-9 q)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
+ #:use-module (2d coroutine)
#:export (make-agenda
with-agenda
agenda-schedule
agenda-schedule-interval
update-agenda
- clear-agenda))
+ clear-agenda
+ wait))
;; This code is a modified version of the agenda implementation in
;; SICP. Thank you, SICP!
@@ -192,3 +194,8 @@ upon every update."
(define (clear-agenda)
"Clear the current agenda."
(%clear-agenda *current-agenda*))
+
+(define* (wait #:optional (delay 1))
+ "Yield coroutine and schdule the continuation to be run after DELAY
+ticks."
+ (yield (lambda (resume) (agenda-schedule resume delay))))