static void thoughtSpaceDone(AbstractThoughtSpace ts) { if (ts != currentThoughtSpace()) fail("Can't close thought space, not current: " + ts); thoughtSpaceDone(); } static void thoughtSpaceDone() { AbstractThoughtSpace ts = currentThoughtSpace(); if (ts instanceof ActualThoughtSpace) thoughtSpace(ts.parent); else print("thoughtSpaceDone without thought space"); }