From de99fc7a0c67d8193d693fec1d7a32dd2713b2f8 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 27 Aug 2014 17:49:04 -0400 Subject: signal: Add signal-negate. * sly/signal.scm (signal-negate): New procedure. --- sly/signal.scm | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3