summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api/signals.texi5
-rw-r--r--sly/signal.scm9
2 files changed, 13 insertions, 1 deletions
diff --git a/doc/api/signals.texi b/doc/api/signals.texi
index 0d8c589..f2773d2 100644
--- a/doc/api/signals.texi
+++ b/doc/api/signals.texi
@@ -218,3 +218,8 @@ the coroutine defined by @var{body}. A special @code{yield} syntax is
available within @var{body} to specify which values are passed to the
signal.
@end deffn
+
+@deffn {Scheme Procedure} signal-call @var{proc-signal} . @var{arg-signals}
+Create a new signal that applies the procedure within
+@var{proc-signal} to the arguments in @var{arg-signals}.
+@end deffn
diff --git a/sly/signal.scm b/sly/signal.scm
index 0ddda2a..e57e880 100644
--- a/sly/signal.scm
+++ b/sly/signal.scm
@@ -53,7 +53,8 @@
signal-every signal-timer signal-since
signal-delay
signal-throttle
- signal-generator))
+ signal-generator
+ signal-call))
;;;
;;; Signals
@@ -425,3 +426,9 @@ ticks."
(lambda () body ...))
handler))
signal))
+
+(define (signal-call proc-signal . arg-signals)
+ "Create a new signal that applies the procedure within PROC-SIGNAL
+to the arguments in ARG-SIGNALS."
+ (apply signal-map (lambda (proc . args) (apply proc args))
+ proc-signal arg-signals))