compat: Add 'call-with-input-string' for Mes.
* gash/compat.scm [mes] (call-with-input-string): New procedure.
This commit is contained in:
parent
efe0522d06
commit
d088464510
|
@ -100,6 +100,7 @@
|
||||||
file-port?
|
file-port?
|
||||||
input-port?
|
input-port?
|
||||||
output-port?
|
output-port?
|
||||||
|
call-with-input-string
|
||||||
thunk?)
|
thunk?)
|
||||||
|
|
||||||
(define-macro (define-inlinable . rest)
|
(define-macro (define-inlinable . rest)
|
||||||
|
@ -169,6 +170,13 @@
|
||||||
(define (input-port? port) #f)
|
(define (input-port? port) #f)
|
||||||
(define (output-port? port) #f)
|
(define (output-port? port) #f)
|
||||||
|
|
||||||
|
(define (call-with-input-string str proc)
|
||||||
|
(let ((port (open-input-string str)))
|
||||||
|
(call-with-values (lambda () (proc port))
|
||||||
|
(lambda results
|
||||||
|
(close-port port)
|
||||||
|
(apply values results)))))
|
||||||
|
|
||||||
;; Fix 'dup' interface.
|
;; Fix 'dup' interface.
|
||||||
(let ((mes/dup dup))
|
(let ((mes/dup dup))
|
||||||
(define* (guile/dup fd #:optional new)
|
(define* (guile/dup fd #:optional new)
|
||||||
|
|
Loading…
Reference in New Issue