def eval_file(self, filename, env=None): path = self.find_file(filename) if path is None: msg = f"load error: {filename} not found" raise exceptions.EvalError(msg) with path.open() as in_stream: return self.eval_stream(in_stream, env=env)
def arithmetic_eq(x, *rest): if len(rest) < 1: raise exceptions.EvalError("=: expected at least 2 arguments") for y in rest: if x != y: return False x = y return True
def ge(x, *rest): if len(rest) < 1: raise exceptions.EvalError(">=: expected at least 2 arguments") for y in rest: if not x >= y: return False x = y return True