home *** CD-ROM | disk | FTP | other *** search
- ch1=channel();
- ch2=channel();
- eos="eos";
- task suppress(inp,out;x,y) {inp?x;if(x==eos) {out!x;skip;}
- while (true) {inp?y;if(y==eos) {out! x; out!y;skip;}
- if(x!=y) {out!x;x=y;} }};
- task source(out) {out!1;out!2;out!2;out!3;out!4;
- out!4;out!4;out!eos;};
- task sink(inp;msg) {inp?msg;while(msg!=eos) {print msg;inp?msg;}};
- task main() {start source(ch1);start suppress(ch1,ch2);
- start sink(ch2);};
- end
-