From dd6394d93dc21305e26232891daf5b19c226dd3a Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 6 Aug 2013 21:06:18 +0800 Subject: dot sign support in literal mode --- model.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'model.cpp') diff --git a/model.cpp b/model.cpp index 287c20a..4cfdca0 100644 --- a/model.cpp +++ b/model.cpp @@ -40,9 +40,10 @@ bool EvalObj::is_opt_obj() { } bool EvalObj::is_cons_obj() { - return otype & CLS_CONS_OBJ; + return this != empty_list && (otype & CLS_CONS_OBJ); } + bool EvalObj::is_num_obj() { return otype & CLS_NUM_OBJ; } @@ -227,7 +228,10 @@ string VecObj::ext_repr() { string res = "#("; for (EvalObjVec::iterator it = vec.begin(); it != vec.end(); it++) res += (*it)->ext_repr() + " "; - res[res.length() - 1] = ')'; + if (vec.begin() == vec.end()) + res += ')'; + else + res[res.length() - 1] = ')'; return res; } -- cgit v1.2.3