diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-27 17:49:04 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-27 17:49:04 -0400 |
commit | de99fc7a0c67d8193d693fec1d7a32dd2713b2f8 (patch) | |
tree | d1ad384df8c301f5647186999d23a8eca2d66d88 | |
parent | d2dd29e31dd5859a659112d32a8f32759c0668c0 (diff) |
signal: Add signal-negate.
* sly/signal.scm (signal-negate): New procedure.
-rw-r--r-- | sly/signal.scm | 6 |
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 |