ack/lang/occam/test/copy.ocm

27 lines
308 B
Plaintext
Raw Permalink Normal View History

1987-02-25 17:14:10 +00:00
def N=10:
proc copy(chan in, out)=
var char:
seq
char:='x'
while char<>EOF
seq
in ? char
out ! char
:
chan junk[N]:
par
copy(input, junk[0])
par i=[0 FOR N-1]
copy(junk[i], junk[i+1])
var char:
seq
junk[N-1] ? char
while char<>EOF
seq
output ! char
junk[N-1] ? char