Merge pull request #406 from chr15m/lib-alias-hacks
[jackhill/mal.git] / rpython / step8_macros.py
index fdf5121..c231b10 100644 (file)
@@ -77,10 +77,12 @@ def EVAL(ast, env):
         #print("EVAL %s" % printer._pr_str(ast))
         if not types._list_Q(ast):
             return eval_ast(ast, env)
+        if len(ast) == 0: return ast
 
         # apply list
         ast = macroexpand(ast, env)
-        if not types._list_Q(ast): return ast
+        if not types._list_Q(ast):
+            return eval_ast(ast, env)
         if len(ast) == 0: return ast
         a0 = ast[0]
         if isinstance(a0, MalSym):
@@ -181,8 +183,10 @@ def entry_point(argv):
             break
         except reader.Blank:
             continue
+        except types.MalException as e:
+            print(u"Error: %s" % printer._pr_str(e.object, False))
         except Exception as e:
-            print("%s" % e)
+            print("Error: %s" % e)
             #print("".join(traceback.format_exception(*sys.exc_info())))
     return 0