The following program fails: #!r6rs (import (rnrs)) (define port (open-bytevector-input-port '#vu8())) (set-port-position! port (port-position port))
and the following fails, too: #!r6rs (import (rnrs)) (define port (open-bytevector-input-port '#vu8(1 2 3))) (write (port-position port))(newline) (get-u8 port) (write (port-position port))(newline) (get-u8 port) (write (port-position port))(newline) (get-u8 port) (write (port-position port))(newline) (set-port-position! port (port-position port)) because of an attempt to set the port position to an invalid value; but if a position is returned by PORT-POSITION, it must be possible to SET-PORT-POSITION! to such value. All the R6RS implementations I tested (but Mosh) accept this. -- Marco Maggi