RefAnyStream.mesa: an interface for applications
of a simple REF ANY stream abstraction
Jlarson, July 10, 1985 3:54:59 pm PDT
RefAnyStream: DEFINITIONS =
{
TYPEs
Handle: TYPE = REF Object;
Object: TYPE = RECORD[
procs: ObjectProcsHandle,
data: REF ANYNIL
];
ObjectProcsHandle: TYPE = REF ObjectProcs;
ObjectProcs: TYPE = RECORD[
get: PROC[Handle] RETURNS[REF ANY],
put: PROC[Handle, REF ANY],
putBack: PROC[Handle, REF ANY],
flush: PROC[Handle],
close: PROC[Handle],
endOf: PROC[Handle] RETURNS[BOOLEAN],
empty: PROC[Handle] RETURNS[BOOLEAN]
];
ERRORs
Error: ERROR [ec: ErrorCode];
ErrorCode: TYPE = {
NotImplementedForThisStream,
EndOfStream,
attempt to do a get at end of stream
StreamClosed,
raised by operations after close (except flush, reset, close.)
BadIndex
negative length or index to SetIndex
};
}.