New util-stdout API.
This commit is contained in:
parent
e42ca1cca5
commit
7a19204242
2 changed files with 13 additions and 2 deletions
|
@ -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))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue