diff options
-rw-r--r-- | sly/signal.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sly/signal.scm b/sly/signal.scm index 8e150a2..8e2c64d 100644 --- a/sly/signal.scm +++ b/sly/signal.scm @@ -24,6 +24,7 @@ (define-module (sly signal) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-26) #:use-module (sly agenda) #:use-module (sly coroutine) @@ -77,6 +78,15 @@ signal-box? (signal signal-unbox signal-box-set!)) +;; The user always sees the boxes, so let's hide the underlying +;; details. +(set-record-type-printer! + <signal-box> + (lambda (box port) + (let ((signal (signal-unbox box))) + (format port "#<signal value: ~a inputs: ~a>" + (%signal-ref signal) (signal-inputs signal))))) + ;; Alternate spelling of signal-box? for the public API. (define signal? signal-box?) |