Esempio n. 1
0
File: eval.py Progetto: cdparks/zeta
def eval_load(s, env):
    """Evaluate sequence of expressions in current environment"""
    with open(car(s)) as stream:
        value = NIL
        for expression in parse_file(stream):
            value = eval(expression, env)
        return value
Esempio n. 2
0
File: eval.py Progetto: cdparks/zeta
def zeta(stream):
    eval_load(single('src/library.lisp'), global_env)
    if stream.isatty():
        repl(global_env)
    else:
        for expr in parse_file(stream):
            try:
                eval(expr, global_env)
            except (KeyboardInterrupt, EOFError):
                break
            except Exception as e:
                printError(e)
                break