gash/gash/io.scm

25 lines
522 B
Scheme
Raw Normal View History

2017-02-19 12:49:30 +00:00
(define-module (gash io)
2017-02-19 09:17:49 +00:00
2018-07-07 18:32:46 +01:00
#:use-module (srfi srfi-1)
2018-07-15 16:46:03 +01:00
#:export (pke stdout stderr))
2017-02-19 09:17:49 +00:00
2017-04-08 20:39:43 +01:00
(define (output port o)
2017-02-19 09:17:49 +00:00
(map (lambda (o) (display o port)) o)
(newline port)
(force-output port))
(define (stdout . o)
(output (current-output-port) o)
2018-07-07 18:32:46 +01:00
(last o))
2017-02-19 09:17:49 +00:00
(define (stderr . o)
(output (current-error-port) o)
2018-07-07 18:32:46 +01:00
(last o))
2018-07-15 16:46:03 +01:00
(define (pke . stuff)
(newline (current-error-port))
(display ";;; " (current-error-port))
(write stuff (current-error-port))
(newline (current-error-port))
(car (last-pair stuff)))