From 34da564b38bb41a80bf5aa465a17e2d8daac2405 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 3 Dec 2013 21:06:21 -0500 Subject: Change signal-merge to accept an arbitrary amount of signals. * 2d/signals.scm (signal-merge): Accept many signals. --- 2d/signals.scm | 13 +++++-------- 1 file 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 -- cgit v1.2.3