zippy / ceptr

(a recomposable medium for distributed social computing) || (semantic self-describing protocol stacks)
http://ceptr.org
GNU General Public License v3.0
89 stars 17 forks source link

add instructions for usual stream operations #30

Open zippy opened 9 years ago

zippy commented 9 years ago

this is for things like moving the current position on a stream, resetting a stream, etc.

zippy commented 9 years ago

94e2ea2cc adds an instruction STREAM_AVAILABLE that returns a BOOLEAN if the stream hasn't reached EOF.

This code still has significant issues in that if EOF is reached during a STREAM_READ, especially on the first call of fgetc() then the read will return an empty string symbol. It's not clear what we want to do in that case.

zippy commented 9 years ago

Realized that it makes lots of sense to just generalize the STREAM instructions to multiple types of streams, and add UNIX streams as just one case. The surface of a STREAM structured object would then be ceptr c struct that can hold stream state data (like EOF stuff). Also, in the case of UNIX streams (and other non-semantic streams) we can use the structure of the RESULT_SYMBOL to infer how to interpret the stream's data.

zippy commented 9 years ago

generalized streams in 48d3e032