sclass VarWithNotify extends Var { event fireChange; // clever way (I hope) to do eq() outside of synchronization block public void set(A a) { A v = get(); if (eq(v, a)) { print ifdef VarWithNotify_debug("VarWithNotify.set no change " + a); ret; } print ifdef VarWithNotify_debug("VarWithNotify.set change " + a); synchronized { this.v = a; } fireChange(); } }