summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-06 17:30:19 -0400
committerDavid Thompson <davet@gnu.org>2015-06-06 17:30:19 -0400
commit2159664c2a5c71b1e2a4cee4b9dd087fad6aa9a2 (patch)
treef56c0272ba646186b7f4a0fbe4f4ba9f62aa72ef
parentd9e182c3204d43730d465611ad2c0ecc3674746a (diff)
signal: Redefine the semantics of signal-let and signal-let*.
* sly/signal.scm (signal-let, signal-let*): Reimplement.
-rw-r--r--sly/signal.scm18
1 files changed, 9 insertions, 9 deletions
diff --git a/sly/signal.scm b/sly/signal.scm
index f5dd3cf..9547f17 100644
--- a/sly/signal.scm
+++ b/sly/signal.scm
@@ -184,15 +184,15 @@ be coerced into one."
#'(define name (make-signal-maybe value))))))
(define-syntax-rule (signal-let ((var signal) ...) body ...)
- ((lambda (var ...) body ...) (signal-ref signal) ...))
-
-(define-syntax signal-let*
- (syntax-rules ()
- ((_ ((var signal)) body ...)
- (signal-let ((var signal)) body ...))
- ((_ ((var signal) . rest) body ...)
- (signal-let ((var signal))
- (signal-let* rest body ...)))))
+ "Similar to 'let', but produces a signal whose value is dependent
+upon all signals in the bindings list."
+ (signal-map (lambda (var ...) body ...) signal ...))
+
+(define-syntax-rule (signal-let* ((var signal) ...) body ...)
+ "Similar to 'signal-let', but the signal variable bindings are
+performed sequentially."
+ (let* ((var signal) ...)
+ (signal-map (lambda (var ...) body ...) var ...)))
;;;
;;; Signal Combinators