aboutsummaryrefslogtreecommitdiff
path: root/model.cpp
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-06 21:06:18 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-06 21:06:18 +0800
commitdd6394d93dc21305e26232891daf5b19c226dd3a (patch)
tree93f6b5d0e85682b4f2b0d1f25e89cf77bafa45d5 /model.cpp
parent3406f0a979e2465a993b20c2eb1033729c6a787c (diff)
dot sign support in literal mode
Diffstat (limited to 'model.cpp')
-rw-r--r--model.cpp8
1 files changed, 6 insertions, 2 deletions
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;
}