(* buffer.sig *) (* CML buffers of fixed maximum length *) signature BUFFER = sig (* a buffer with fixed maximum length whose elements have type 'a *) type 'a buffer (* exception raised by make *) exception Size (* create a buffer with a given maximum length; raises Size if the length is not positive *) val make : int -> 'a buffer (* add(buf, x) adds x to the end of buf, and then returns (); it blocks until the addition is possible *) val add : 'a buffer * 'a -> unit (* del buf deletes the first element of buf, and returns the deleted element; it blocks until the deletion is possible *) val del : 'a buffer -> 'a end;