diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2016-08-24 11:55:27 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2016-08-24 11:55:27 -0400 |
commit | 1e4e390c77a6726bf6605cf16dcc11e8aea451e7 (patch) | |
tree | ab050eee924967295ad47ab24e9398b87965efb8 | |
parent | 8ed18c93a899a15da868f41f5d284c64227e142d (diff) |
signal: Reimplement signal-fold.
* sly/signal.scm (signal-fold): There was no need for using let-over-lambda.
-rw-r--r-- | sly/signal.scm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sly/signal.scm b/sly/signal.scm index c1f16e7..3f5972f 100644 --- a/sly/signal.scm +++ b/sly/signal.scm @@ -299,13 +299,11 @@ SIGNAL. PROC is applied with the current value of SIGNAL and the previously computed value, or INIT for the first call." (let ((inputs (cons signal rest))) (make-boxed-signal init - (let ((previous init)) - (lambda (self value) - (let ((x (apply proc - (append (map signal-ref inputs) - (list previous))))) - (set! previous x) - (%signal-set! self x)))) + (lambda (self value) + (let ((x (apply proc + (append (map signal-ref inputs) + (list (%signal-ref self)))))) + (%signal-set! self x))) inputs))) (define (signal-filter predicate default signal) |