From e659085e675c331bfbd43c85c101af21978145b4 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 14 Oct 2017 21:27:47 -0400 Subject: scripting: Rename wait to sleep. * chickadee/scripting.scm (wait): Rename to... (sleep): ...this. --- chickadee/scripting.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chickadee/scripting.scm b/chickadee/scripting.scm index d4a2b81..0e29fa6 100644 --- a/chickadee/scripting.scm +++ b/chickadee/scripting.scm @@ -22,8 +22,9 @@ #:use-module (chickadee scripting channel) #:use-module (chickadee scripting coroutine) #:export (forever - wait - tween)) + sleep + tween) + #:replace (sleep)) ;; Export public bindings from other modules. (eval-when (eval load compile) @@ -40,8 +41,10 @@ "Evaluate BODY in an endless loop." (while #t body ...)) -(define (wait duration) +(define (sleep duration) "Wait DURATION before resuming the current coroutine." + ;; Capture the current agenda before suspending the coroutine so + ;; that we schedule the continuation in the right place. (let ((agenda (current-agenda))) (yield (lambda (cont) @@ -66,5 +69,5 @@ END. By default, linear interpolation is used." (proc end) (let ((alpha (ease (/ t duration)))) (proc (interpolate start end alpha)) - (wait step) + (sleep step) (loop (+ t step)))))) -- cgit v1.2.3