plpgsql: IO using stream table. Add keywords.
[jackhill/mal.git] / python / step1_read_print.py
index 0315cf0..c167e38 100644 (file)
@@ -9,9 +9,10 @@ def READ(str):
 
 # 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)
 
@@ -19,6 +20,7 @@ def PRINT(exp):
 def REP(str):
     return PRINT(EVAL(READ(str), {}))
 
+# repl loop
 while True:
     try:
         line = mal_readline.readline("user> ")
@@ -27,4 +29,4 @@ while True:
         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())))