fix flush for `make-pipe-with-specials'
Closes PR 12659
This commit is contained in:
parent
f301838511
commit
0cfb3f1d39
|
@ -710,7 +710,7 @@
|
|||
;; write
|
||||
(lambda (str start end buffer? w/break?)
|
||||
(if (= start end)
|
||||
#t
|
||||
0
|
||||
(begin
|
||||
(resume-mgr)
|
||||
(call-with-semaphore
|
||||
|
|
|
@ -877,6 +877,23 @@
|
|||
(eq? (cadr r) 4)
|
||||
(memq (cadr r) '(2 4))))))
|
||||
|
||||
|
||||
(let-values ([(in out) (make-pipe-with-specials)])
|
||||
(struct str (v)
|
||||
#:property prop:custom-write
|
||||
(lambda (a-str port mode)
|
||||
(let ([recur (case mode
|
||||
[(#t) write]
|
||||
[(#f) display]
|
||||
[else
|
||||
(lambda (p port)
|
||||
(print p port mode))])])
|
||||
(recur (str-v a-str) port))))
|
||||
(write (str "hello world") out)
|
||||
(flush-output out)
|
||||
(test "hello world" read in))
|
||||
|
||||
|
||||
;; --------------------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
Loading…
Reference in New Issue
Block a user