From e87d73810cb0a47cd31f9d0f3a65a4a39435883c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 30 Nov 2014 13:59:41 -0500 Subject: signal: Add signal-time. * sly/signal.scm (signal-time): New procedure. --- sly/signal.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sly/signal.scm b/sly/signal.scm index 20d5ba6..bf69438 100644 --- a/sly/signal.scm +++ b/sly/signal.scm @@ -48,7 +48,7 @@ signal-constant signal-count signal-tap - signal-timestamp + signal-timestamp signal-time signal-sample signal-every signal-since signal-delay @@ -318,6 +318,11 @@ of SIGNAL." (signal-map (cut cons (agenda-time) <>) signal)) (define (signal-sample delay signal) +(define (signal-time signal) + "Create a new signal whose value is the time that the latest value +of SIGNAL was received." + (signal-map (lambda _ (agenda-time)) signal)) + "Create a new signal that emits the value contained within SIGNAL every DELAY ticks of the current agenda." ;; To prevent memory leaks, the new signal is stored within a weak -- cgit v1.2.3