Oz mode
x
1
declare
2
fun {Ints N Max}
3
if N == Max then nil
4
else
5
{Delay 1000}
6
N|{Ints N+1 Max}
7
end
8
end
9
10
fun {Sum S Stream}
11
case Stream of nil then S
12
[] H|T then S|{Sum H+S T} end
13
end
14
15
local X Y in
16
thread X = {Ints 0 1000} end
17
thread Y = {Sum 0 X} end
18
{Browse Y}
19
end
20
MIME type defined: text/x-oz
.