diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-06 21:06:18 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-06 21:06:18 +0800 |
commit | dd6394d93dc21305e26232891daf5b19c226dd3a (patch) | |
tree | 93f6b5d0e85682b4f2b0d1f25e89cf77bafa45d5 /model.cpp | |
parent | 3406f0a979e2465a993b20c2eb1033729c6a787c (diff) |
dot sign support in literal mode
Diffstat (limited to 'model.cpp')
-rw-r--r-- | model.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |