compat: Add 'call-with-input-string' for Mes.

* gash/compat.scm [mes] (call-with-input-string): New procedure.
This commit is contained in:
Timothy Sample 2022-04-29 21:42:42 -06:00
parent efe0522d06
commit d088464510
1 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,7 @@
file-port?
input-port?
output-port?
call-with-input-string
thunk?)
(define-macro (define-inlinable . rest)
@ -169,6 +170,13 @@
(define (input-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.
(let ((mes/dup dup))
(define* (guile/dup fd #:optional new)