[R6RS] Should `open-bytes-input-port' copy its argument?

dyb at cs.indiana.edu dyb at cs.indiana.edu
Fri Aug 25 21:42:44 EDT 2006

> Subject says all.  (Will spotted this.)  My idea was that it should,
> just like `open-bytes-reader'.  Other preference anyone? 

I much prefer that it not copy it's argument, but that the behavior be
unspecified if the bytes objects is modified.  The mechanism is there for
user's to copy the bytes object if they want; we don't have to do it for
them and make the bytes input-port unnecessarily expensive in the process.

In fact, I think people will often suck a file into a bytes object, then
use open-bytes-input-port to read from it to avoid file-modification
issues.  They'd be rightly upset at the cost of the additional copy when
they have no intention of modifying the bytes object.


More information about the R6RS mailing list