diff --git a/scheme/ikarus.io.input-strings.ss b/scheme/ikarus.io.input-strings.ss index 61a8432..83e2b53 100644 --- a/scheme/ikarus.io.input-strings.ss +++ b/scheme/ikarus.io.input-strings.ss @@ -15,7 +15,7 @@ (library (ikarus io input-strings) - (export open-input-string with-input-from-string) + (export open-input-string open-string-input-port with-input-from-string) (import (ikarus system $strings) (ikarus system $bytevectors) @@ -23,7 +23,9 @@ (ikarus system $pairs) (ikarus system $ports) (ikarus system $io) - (except (ikarus) open-input-string with-input-from-string)) + (except (ikarus) + open-input-string open-string-input-port + with-input-from-string)) (define-syntax message-case (syntax-rules (else) @@ -82,15 +84,23 @@ (error 'input-string-handler "message not handled" (cons msg args))]))))) + (define ($open-input-string str) + (let ([port (make-input-port + (make-input-string-handler str) + '#vu8())]) + port)) + (define open-input-string (lambda (str) (unless (string? str) (error 'open-input-string "not a string" str)) - (let ([port (make-input-port - (make-input-string-handler str) - '#vu8())]) - port))) + ($open-input-string str))) + (define open-string-input-port + (lambda (str) + (unless (string? str) + (error 'open-string-input-port "not a string" str)) + ($open-input-string str))) (define with-input-from-string (lambda (str proc) diff --git a/scheme/last-revision b/scheme/last-revision index 0141c45..cca9df4 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1104 +1105 diff --git a/scheme/makefile.ss b/scheme/makefile.ss index 819fbc5..0cd888c 100755 --- a/scheme/makefile.ss +++ b/scheme/makefile.ss @@ -1125,8 +1125,8 @@ [open-file-input-port r ip] [open-file-input/output-port r ip] [open-file-output-port r ip] - [open-string-input-port r ip] - [open-string-output-port r ip] + [open-string-input-port i r ip] + [open-string-output-port i r ip] [output-port-buffer-mode r ip] [port-eof? r ip] [port-has-port-position? r ip]