static void thoughtSpaceDone() { AbstractThoughtSpace ts = currentThoughtSpace(); if (ts instanceof ActualThoughtSpace) thoughtSpace(ts.parent); else print("thoughtSpaceDone without thought space"); } // set for current thread static A thoughtSpace(A ts) { currentThoughtSpace_value.set(ts); ret ts; }