import Compat;
import types.Types.MalType;
import types.Types.*;
+import types.MalException;
import reader.*;
import printer.*;
import env.*;
// apply
var alst = _list(ast);
+ if (alst.length == 0) { return ast; }
switch (alst[0]) {
case MalSymbol("def!"):
} catch (exc:haxe.io.Eof) {
Compat.exit(0);
} catch (exc:Dynamic) {
- Compat.println(exc);
+ if (Type.getClass(exc) == MalException) {
+ Compat.println("Error: " + Printer.pr_str(exc.obj, true));
+ } else {
+ Compat.println("Error: " + exc);
+ };
}
}
}