sclass VarWithNotify extends Var is IVarWithNotify { event fireChange; *() {} *(A a) { super(a); } // 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; notifyAll(); } fireChange(); } }