Merge pull request #377 from asarhaddon/fix-runtests-pre-eval
[jackhill/mal.git] / coffee / step6_file.coffee
index 2a0ded0..b1b786c 100644 (file)
@@ -24,6 +24,7 @@ EVAL = (ast, env) ->
  loop
   #console.log "EVAL:", printer._pr_str ast
   if !types._list_Q ast then return eval_ast ast, env
+  if ast.length == 0 then return ast
 
   # apply list
   [a0, a1, a2, a3] = ast
@@ -86,7 +87,7 @@ while (line = readline.readline("user> ")) != null
     continue if exc instanceof reader.BlankException
     if exc.stack? and exc.stack.length > 2000
       console.log exc.stack.slice(0,1000) + "\n  ..." + exc.stack.slice(-1000)
-    else if exc.stack? console.log exc.stack
-    else               console.log exc
+    else if exc.stack? then console.log exc.stack
+    else                    console.log exc
 
 # vim: ts=2:sw=2