mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
* srfi-19.scm (priv:locale-reader): don't need open-output-string.
This commit is contained in:
parent
f91e4547f4
commit
b4d2a48e9d
1 changed files with 12 additions and 12 deletions
|
@ -1362,18 +1362,18 @@
|
|||
|
||||
;; looking at a char, read the char string, run thru indexer, return index
|
||||
(define (priv:locale-reader port indexer)
|
||||
(let ((string-port (open-output-string)))
|
||||
(define (read-char-string)
|
||||
(let ((ch (peek-char port)))
|
||||
(if (char-alphabetic? ch)
|
||||
(begin (write-char (read-char port) string-port)
|
||||
(read-char-string))
|
||||
(get-output-string string-port))))
|
||||
(let* ((str (read-char-string))
|
||||
(index (indexer str)))
|
||||
(if index index (priv:time-error 'string->date
|
||||
'bad-date-template-string
|
||||
(list "Invalid string for " indexer))))))
|
||||
|
||||
(define (read-char-string result)
|
||||
(let ((ch (peek-char port)))
|
||||
(if (char-alphabetic? ch)
|
||||
(read-char-string (cons (read-char port) result))
|
||||
(list->string (reverse! result)))))
|
||||
|
||||
(let* ((str (read-char-string '()))
|
||||
(index (indexer str)))
|
||||
(if index index (priv:time-error 'string->date
|
||||
'bad-date-template-string
|
||||
(list "Invalid string for " indexer)))))
|
||||
|
||||
(define (priv:make-locale-reader indexer)
|
||||
(lambda (port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue