summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-12-03 21:06:21 -0500
committerDavid Thompson <dthompson@member.fsf.org>2013-12-03 21:06:21 -0500
commit34da564b38bb41a80bf5aa465a17e2d8daac2405 (patch)
tree60fa40df5700cd56299af377d74874154f0bf109
parent030785a482064c3e88231adff25108e7233e7d69 (diff)
Change signal-merge to accept an arbitrary amount of signals.
* 2d/signals.scm (signal-merge): Accept many signals.
-rw-r--r--2d/signals.scm13
1 files changed, 5 insertions, 8 deletions
diff --git a/2d/signals.scm b/2d/signals.scm
index 018684c..04de9c0 100644
--- a/2d/signals.scm
+++ b/2d/signals.scm
@@ -181,14 +181,11 @@ onto SIGNAL1, SIGNAL2, SIGNAL3, and SIGNAL4."
(signal-ref signal4)))
#:connectors (list signal1 signal2 signal3 signal4)))
-(define (signal-merge signal1 signal2)
- "Create a new signal that merges SIGNAL1 and SIGNAL2 into one. The
-value of the new signal is the value of the most recently changed
-parent signal."
- (make-signal
- #:transformer (lambda (value prev from)
- value)
- #:connectors (list signal1 signal2)))
+(define (signal-merge . signals)
+ "Create a new signal that merges every signal in the list SIGNALS
+into one. The value of the new signal is the value of the most
+recently changed signal in the list."
+ (make-signal #:connectors signals))
(define (signal-combine . signals)
"Create a new signal that combines the values of SIGNALS into a