shithub: purgatorio

ref: 8a788aea84aad3bfbd5b39d78c1925654f3b9e14
dir: purgatorio/module/watchvars.m

View raw version
Watchvars: module {
	PATH: con "/dis/lib/watchvars.dis";
	Watchvar: adt[T] {
		c: chan of (T, chan of T);

		new:	fn(v: T): Watchvar[T];
		get:	fn(e: self Watchvar[T]): T;
		set:	fn(e: self Watchvar[T], v: T);
		wait:	fn(e: self Watchvar[T]): T;
		waitc:	fn(e: self Watchvar[T]): (T, chan of T);
		waited:	fn(e: self Watchvar[T], ic: chan of T, v: T);
	};
};