shen-sources
shen-sources copied to clipboard
Set and get stream position
Stream position manipulation and query functions
There are no stream positions in Shen. Desired functionality:
- go to the beginning of the stream
- go to the end of the stream
- go to an arbitrary position in the stream (relative to beginning, end or current position in stream)
- query the current position in the stream
Current implementations
- https://github.com/tizoc/shen-scheme#stream-position-operations
TODO: add others
@tizoc While we're clearing out the backlog, this and the other kernel-extension issues seem to be off-limits based on responses we've received before. I don't think they can be realized without changing kernel functionality (where the stuff under library/ is fine because it's in addition to the existing kernel)
At this point these are more about finding the common patterns across ports and provide a common API, either as a library (using cond-expand to decide what to do) or ports implementing a defined API. Not much to do for these for now other than wait.
Would ports offer such functionality under a common name? Usually, port- or platform-specific behavior has a port-prefix like shen-jvm.set-position or jvm.set-position.
Yes. Once a common api is figured, ports can provide a version of the library using their own primitives. Alternatively, a standard-library normalizes what ports already provide under a common api using cond-expand. At this point it doesn't matter much because most port don't provide these things, there is no rush to pre-define anything.