% $Id: SumAgentMaker.oz,v 1.2 2007/11/13 22:40:18 leavens Exp leavens $ % To see how to do this with NewPortObject, see NewPortObjectTest.oz declare fun {SumAgentMaker} Strm % declaring the input stream fun {Loop MsgStrm N} case MsgStrm of add(X)|Msgs then {Loop Msgs N+X} [] get(Z)|Msgs then Z=N {Loop Msgs N} end end in thread _={Loop Strm 0} end {NewPort Strm} end