commit 4576bbe9c056515b4791677f4a179140c0f4f4b0
parent 645aec933b06050afb442fe23f33cd0066555eef
Author: Andres Navarro <canavarro82@gmail.com>
Date: Fri, 29 Apr 2011 21:33:07 -0300
Added error writing to objs.
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/kwrite.c b/src/kwrite.c
@@ -397,6 +397,17 @@ void kwrite_simple(klisp_State *K, TValue obj)
#endif
kw_printf(K, "]");
break;
+ case K_TERROR: {
+ kw_printf(K, "#[error: ");
+
+ /* TEMP for now show only msg */
+ bool saved_displayp = K->write_displayp;
+ K->write_displayp = false; /* use "'s and escapes */
+ kw_print_string(K, tv2error(obj)->msg);
+ K->write_displayp = saved_displayp;
+
+ kw_printf(K, "]");
+ }
default:
/* shouldn't happen */
kwrite_error(K, "unknown object type");