sclass Ext extends DynamicObject implements IVar { *() {} *(A *v) {} //O equalityPredicate; // func(Ext, Ext) -> bool bool fullToString; // include values in toString A v; // you can access this directly if you use one thread public synchronized void set(A a) { if (v != a) { v = a; notifyAll(); } } public synchronized A get() { ret v; } public synchronized bool has() { ret v != null; } public synchronized void clear() { v = null; } public bool equals(O o) { ret o instanceof Ext && eq(o/Ext.v, v); } public int hashCode() { ret _hashCode(v); } toString { ret !fullToString ? str(get()) : extToString(this); } }