summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-12-02 09:37:18 -0500
committerDavid Thompson <dthompson@member.fsf.org>2013-12-02 09:37:18 -0500
commit4582ceb5428ef6aee881df57bbdfaea7f2ae6730 (patch)
tree14cd0033a3725203d38edd6441fee6a9e13dae5e /2d
parentc3c5ee977acea4aa9839b15c1cfb8e110316d168 (diff)
Change parameters for time-interval and time-every.
* 2d/time.scm (time-interval, time-every): Add signal parameter.
Diffstat (limited to '2d')
-rw-r--r--2d/time.scm18
1 files changed, 9 insertions, 9 deletions
diff --git a/2d/time.scm b/2d/time.scm
index b4c8c07..aa975a4 100644
--- a/2d/time.scm
+++ b/2d/time.scm
@@ -28,18 +28,18 @@
time-interval
time-delay))
-(define (time-interval ticks)
- "Create a new signal that sets its value to #t every TICKS agenda
-updates."
- (let ((signal (make-signal #:init #t)))
+(define (time-interval ticks signal)
+ "Create a new signal that emits the value of SIGNAL every TICKS
+agenda updates."
+ (let ((ticker (make-signal #:init (signal-ref signal))))
(agenda-schedule-interval
(lambda ()
- (signal-set! signal #t)) ticks)
- signal))
+ (signal-set! ticker (signal-ref signal))) ticks)
+ ticker))
-(define (time-every)
- "Create a new signal that sets its value to #t every agenda update."
- (time-interval 1))
+(define (time-every signal)
+ "Create a new signal that emits the value of SIGNAL every agenda update."
+ (time-interval 1 signal))
(define (time-delay ticks signal)
(make-signal