aboutsummaryrefslogtreecommitdiff
path: root/model.cpp
diff options
context:
space:
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;
}