# eval
def EVAL(ast, env):
- #print("EVAL %s" % ast)
+ #print("EVAL %s" % printer._pr_str(ast))
return ast
+# print
def PRINT(exp):
return printer._pr_str(exp)
def REP(str):
return PRINT(EVAL(READ(str), {}))
+# repl loop
while True:
try:
line = mal_readline.readline("user> ")
print(REP(line))
except reader.Blank: continue
except Exception as e:
- print "".join(traceback.format_exception(*sys.exc_info()))
+ print("".join(traceback.format_exception(*sys.exc_info())))