mark richardson wrote:
Hi,
One more question if anyone can help.
Using ports as suggested gives me a stream which blocks until further
data is available, but is their a way to 'pop' values off the stream?
Ideally I want to read around 100 items from the stream, removing them
as I go. The amount of data to be read during one run of the program
will be very large and the stream will obviously grow as data is
received. However, the program is intended to loop continuously and
therefore I need to have some way of discarding processed stream items.
Any suggestions?
Regards
Mark
'Popping' is automatic. For example:
declare P in
local S in
P={NewPort S}
for X in S do {Browse X} end
end
If you send to the port by doing '{Send P foobar}' then foobar will
appear on the stream S. As soon as it is handled in the for loop, it
becomes inaccessible and garbage collection can remove it.
Peter
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users