commander-s/scheme/tty-debug.scm

20 lines
416 B
Scheme
Raw Normal View History

(define *tty-port* #f)
(define (init-tty-debug-output!)
(call-with-values
open-pty
(lambda (input-port name)
(set! *tty-port* (dup->outport input-port))
2005-05-18 14:56:30 -04:00
(close input-port)
(set-port-buffering *tty-port* bufpol/none)
name)))
(define debug-message
(lambda args
(with-current-output-port*
*tty-port*
(lambda ()
(for-each display args)
2005-05-18 14:56:30 -04:00
(newline)))))