Duck util-stdout.

This commit is contained in:
Dominik Pantůček 2023-07-05 21:52:43 +02:00
parent 323293be0e
commit b027d19f49
5 changed files with 57 additions and 33 deletions

View file

@ -183,3 +183,38 @@ Executes given command ```cmd``` with given argument list ```args```
writing all ```lines``` to its standard input and then reads all the
process output.
## util-stdout [module]
(import util-stdout)
Very simple module wrapping standard output.
### *stdout-quiet* [parameter]
(define *stdout-quiet* (make-parameter #f))
(*stdout-quiet*)
(*stdout-quiet* quiet)
A boolean parameter which disables all output from procedures in this
module if its value is ```#t```.
### stdout-print [procedure]
(stdout-print . args)
If not quiet, passes ```args``` to ```print```.
### stdout-printf [procedure]
(stdout-printf fmt
. args)
If not quiet, prints formatted string ```fmt``` by applying ```args```
to ```format``` procedure.
### stdout-newline [procedure]
(stdout-newline)
If not quiet, calls ```(newline)```.