From d088464510ca58cd5ca79f34e9344b86b6cc576a Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Fri, 29 Apr 2022 21:42:42 -0600 Subject: [PATCH] compat: Add 'call-with-input-string' for Mes. * gash/compat.scm [mes] (call-with-input-string): New procedure. --- gash/compat.scm | 8 ++++++++ 1 file changed, 8 insertions(+) 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)