def eval(self, environment): if trueExpr(self._test.eval(environment)): return self._cons.eval(environment) else: if self._alt: return self._alt.eval(environment) else: return None
def eval(self, environment): if not self._tests: return FALSE for test in self._tests[:-1]: value = test.eval(environment) if trueExpr(value): return value return self._tests[-1].eval(environment)
def evalTest(self, environment): """Evaluates the test and returns true if the test evaluates to true. """ return trueExpr(self._test.eval(environment))