bug#41045: transcoded-port turns input/output ports into output ports

Göran Weinholt <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hello schemers,

The transcoded-port procedure from (rnrs) does not handle input/output
ports properly:

--8<---------------cut here---------------start------------->8---
GNU Guile 3.0.2
Copyright (C) 1995-2020 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (define p (open-file-input/output-port "/dev/null" (file-options no-fail)))
scheme@(guile-user)> (define tp (transcoded-port p (native-transcoder)))
scheme@(guile-user)> (values (output-port? tp) (input-port? tp))
$1 = #t
$2 = #f
--8<---------------cut here---------------end--------------->8---

Both return values should be #t.

-- 
Göran Weinholt   | https://weinholt.se/
Debian developer | 73 de SA6CJK
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.