summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/signal.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/sly/signal.scm b/sly/signal.scm
index 8ecc58d..543f4d0 100644
--- a/sly/signal.scm
+++ b/sly/signal.scm
@@ -39,6 +39,7 @@
signal-merge
signal-zip
signal-map
+ signal-negate
signal-fold
signal-filter
signal-reject
@@ -226,6 +227,11 @@ or more SIGNALS."
(%signal-set! self (current-value)))
inputs)))
+(define (signal-negate signal)
+ "Create a new signal whose value is the 'not' of the value of
+SIGNAL."
+ (signal-map not signal))
+
(define (signal-fold proc init signal . rest)
"Create a new signal that applies PROC to the values stored in
SIGNAL. PROC is applied with the current value of SIGNAL and the