[r6rs-discuss] [Formal] get-bytevector-some may be difficult to implement

From: Per Bothner <per>
Date: Thu Mar 15 03:59:07 2007

---
This message is a formal comment which was submitted to formal-comment_at_r6rs.org, following the requirements described at: http://www.r6rs.org/process.html
---
Type: defect.
Priority: major
Component: I/O
Verison: 5.92
It is unclear to me how one would implement get-bytevector-some.
I don't think it can be implemented reasonably using the read
call-back function of make-custom-binary-port.  The best I can think
of: allocated some largish buffer, call the read call-back, and
the re-allocate a new bytevector with however many bytes were
actually read.  But that still won't return "a freshly allocated
bytevector of non-zero size containing the available data" -
just "a freshly allocated bytevector of non-zero size containing
*part* of the available data".  And it means allocating a
temporary large bytevector and throwing it away.
Fix: remove get-bytevector-some, or clarify that it
reads "one or more of the available characters".  I suggest
the former.
-- 
	--Per Bothner
per_at_bothner.com   http://per.bothner.com/
Received on Wed Mar 14 2007 - 17:00:35 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC