Hi Felix,
I'm in trouble with the custom ports definitions. I _need_ to control
when the output is flushed but make-output-port supports only (write
<string>) and (close) could this modification go into extras.scm?
(Anybody who'd object please speak up ASAP).
(define make-output-port
(let ([string string])
(lambda (write close . flush)
(let ([port (##sys#make-port #f 6 #f #f)]
[data (vector #f)] )
(define (unsup op)
(##sys#error "operation not supported by custom output port" port op)
)
(##sys#setislot port 1 #t)
(##sys#setslot port 3 "(custom)")
(##sys#setislot port 4 0)
(##sys#setislot port 5 0)
(##sys#setslot
port 2
(lambda (op port args)
(case op
[(#:close-output-port) (close)]
[(#:flush-output) (and (pair? flush) ((car flush)))]
[(#:write-char) (write (string args))]
[(#:write-string) (write args)]
[(#:close-input-port #:char-ready? #:read-char #:peek-char)
(unsup op) ]
[(#:data) data]
[else ##sys#snafu] ) ) )
port) ) ) )
Cheers
/Jörg