static bool getAndResetBoolVar(Var v) { bool b = isTrue(v!); v.set(false); ret b; }