Fixes bug 163722: missing open-string-output-port and open-string-input-port
This commit is contained in:
parent
d314bacc24
commit
2eca32fc8e
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
(library (ikarus io input-strings)
|
(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
|
(import
|
||||||
(ikarus system $strings)
|
(ikarus system $strings)
|
||||||
(ikarus system $bytevectors)
|
(ikarus system $bytevectors)
|
||||||
|
@ -23,7 +23,9 @@
|
||||||
(ikarus system $pairs)
|
(ikarus system $pairs)
|
||||||
(ikarus system $ports)
|
(ikarus system $ports)
|
||||||
(ikarus system $io)
|
(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
|
(define-syntax message-case
|
||||||
(syntax-rules (else)
|
(syntax-rules (else)
|
||||||
|
@ -82,15 +84,23 @@
|
||||||
(error 'input-string-handler
|
(error 'input-string-handler
|
||||||
"message not handled" (cons msg args))])))))
|
"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
|
(define open-input-string
|
||||||
(lambda (str)
|
(lambda (str)
|
||||||
(unless (string? str)
|
(unless (string? str)
|
||||||
(error 'open-input-string "not a string" str))
|
(error 'open-input-string "not a string" str))
|
||||||
(let ([port (make-input-port
|
($open-input-string str)))
|
||||||
(make-input-string-handler str)
|
|
||||||
'#vu8())])
|
|
||||||
port)))
|
|
||||||
|
|
||||||
|
(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
|
(define with-input-from-string
|
||||||
(lambda (str proc)
|
(lambda (str proc)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1104
|
1105
|
||||||
|
|
|
@ -1125,8 +1125,8 @@
|
||||||
[open-file-input-port r ip]
|
[open-file-input-port r ip]
|
||||||
[open-file-input/output-port r ip]
|
[open-file-input/output-port r ip]
|
||||||
[open-file-output-port r ip]
|
[open-file-output-port r ip]
|
||||||
[open-string-input-port r ip]
|
[open-string-input-port i r ip]
|
||||||
[open-string-output-port r ip]
|
[open-string-output-port i r ip]
|
||||||
[output-port-buffer-mode r ip]
|
[output-port-buffer-mode r ip]
|
||||||
[port-eof? r ip]
|
[port-eof? r ip]
|
||||||
[port-has-port-position? r ip]
|
[port-has-port-position? r ip]
|
||||||
|
|
Loading…
Reference in New Issue