From 448e3caeaaf0b75d9bcf39b88602849340eb204d Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 6 Aug 2014 22:15:49 +0900 Subject: [PATCH] don't use user printer for records in debug mode --- src/write.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/write.c b/src/write.c index 074feba7..70a547b9 100644 --- a/src/write.c +++ b/src/write.c @@ -180,6 +180,12 @@ write_record(pic_state *pic, struct pic_record *rec, xFILE *file) const pic_sym sWRITER = pic_intern_cstr(pic, "writer"); pic_value type, writer, str; +#if DEBUG + + xfprintf(file, "#", rec); + +#else + type = pic_record_type(pic, rec); if (! pic_record_p(type)) { pic_errorf(pic, "\"@@type\" property of record object is not of record type"); @@ -193,6 +199,8 @@ write_record(pic_state *pic, struct pic_record *rec, xFILE *file) pic_errorf(pic, "return value from writer procedure is not of string type"); } xfprintf(file, "%s", pic_str_cstr(pic_str_ptr(str))); + +#endif } static void