New util-stdout API.

This commit is contained in:
Dominik Pantůček 2023-05-10 20:12:25 +02:00
parent e42ca1cca5
commit 7a19204242
2 changed files with 13 additions and 2 deletions

View file

@ -30,6 +30,7 @@
(
*stdout-quiet*
stdout-print
stdout-printf
)
(import scheme
@ -40,7 +41,12 @@
(define *stdout-quiet* (make-parameter #f))
;; Prints to stdout if not quiet
(define (stdout-print fmt . args)
(define (stdout-print . args)
(when (not (*stdout-quiet*))
(apply print args)))
;; Prints formatted string to stdout if not quiet
(define (stdout-printf fmt . args)
(when (not (*stdout-quiet*))
(print (apply format fmt args))))