home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / interpre / proxy / nodup.prx < prev    next >
Encoding:
Text File  |  1992-11-24  |  444 b   |  13 lines

  1. ch1=channel();
  2. ch2=channel();
  3. eos="eos";
  4. task suppress(inp,out;x,y) {inp?x;if(x==eos) {out!x;skip;}
  5.   while (true) {inp?y;if(y==eos) {out! x; out!y;skip;}
  6.   if(x!=y) {out!x;x=y;} }};
  7. task source(out) {out!1;out!2;out!2;out!3;out!4;
  8.                   out!4;out!4;out!eos;};
  9. task sink(inp;msg) {inp?msg;while(msg!=eos) {print msg;inp?msg;}};
  10. task main() {start source(ch1);start suppress(ch1,ch2);
  11.              start sink(ch2);};
  12. end
  13.