1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-28 14:00:31 +02:00

Second argument of ‘unread-string’ is optional.

Fixes <https://bugs.gnu.org/67063>.

* doc/ref/api-io.texi (Venerable Port Interfaces): Bring unread-string
procedure documentation in line with other procedures in the section.
* libguile/ports.c (scm_unread_string): Make port argument optional.
* test-suite/tests/ports.test: Test unread-char and unread-string
without ports.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Juliana Sims 2023-11-10 23:25:56 -05:00 committed by Ludovic Courtès
parent 80d4055e42
commit a222503a89
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
4 changed files with 7 additions and 5 deletions

View file

@ -636,13 +636,13 @@
(with-input-from-string "walk on the moon\nmoon"
(lambda ()
(read-char)
(unread-char #\a (current-input-port))
(unread-char #\a)
(pass-if "unread-char"
(char=? (read-char) #\a))
(read-line)
(let ((replacenoid "chicken enchilada"))
(unread-char #\newline (current-input-port))
(unread-string replacenoid (current-input-port))
(unread-char #\newline)
(unread-string replacenoid)
(pass-if "unread-string"
(string=? (read-line) replacenoid)))
(pass-if "unread residue"