port position-tracking clean-ups
Add `file-position*', which can return #f instead of raising an exception when a port's position is unknown. Change `make-input-port' and `make-output-port' to accept more kinds of values as the initial position. These changes make it possible to synchronize a port's position with a `port-commit-peeked' action. It's ugly, which I think reflect something broken about position tracking in the port protocol (which seems difficult to fix without breaking compaibility). original commit: b61f3f751c5dfe72869fd449ba3ff42f520d0927
This commit is contained in:
parent
c9a754132a
commit
10d9de8b62
|
@ -2155,6 +2155,7 @@
|
|||
[(-Port (one-of/c 'none 'line 'block)) -Void])]
|
||||
[file-position (cl-> [(-Port) -Nat]
|
||||
[(-Port -Integer) -Void])]
|
||||
[file-position* (-> -Port (Un -Nat (-val #f)))]
|
||||
|
||||
;Section 12.1.4
|
||||
[port-count-lines! (-> (Un -Input-Port -Output-Port) -Void)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user