[r6rs-discuss] [Formal] allow port position to be "magic cookie"
Per Bothner
per at bothner.com
Wed Mar 14 16:52:04 EDT 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 of issue: Enhancement
Priority: Minor
Component: I/O
Version: 5.92
port-position and set-port-position! are specified to get/set the
port's current position as a byte offset. But there are many kinds
of ports which do have a position, and on which the position can be
changed, but not using a byte offset. This includes most text ports
(except those implemented using simple stateless transcoders).
In some cases a character offset may make more sense.
Suggestion: For non-binary ports allow the use of any arbitrary
integral "magic cookie" as the position. One could also allow
an arbitrary value (such as a record), though that reduces the
"typeability" of these procedures. However, that would allow
a straight-forward wrapping of C's fgetpos/fsetpos.
--
--Per Bothner
per at bothner.com http://per.bothner.com/
More information about the r6rs-discuss
mailing list