diff --git a/gash/compat.scm b/gash/compat.scm index 4e811e6..1157508 100644 --- a/gash/compat.scm +++ b/gash/compat.scm @@ -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)