aboutsummaryrefslogtreecommitdiff
path: root/model.cpp
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-06 19:11:22 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-06 19:11:22 +0800
commit3406f0a979e2465a993b20c2eb1033729c6a787c (patch)
treed37e6148a211732fc3d59ca428d2bef7309736b8 /model.cpp
parent033b938b22c7947992195e380fb2f7d1ca200f05 (diff)
added and restructured built-in procedures
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 4a3c22a..287c20a 100644
--- a/model.cpp
+++ b/model.cpp
@@ -47,6 +47,10 @@ bool EvalObj::is_num_obj() {
return otype & CLS_NUM_OBJ;
}
+bool EvalObj::is_bool_obj() {
+ return otype & CLS_BOOL_OBJ;
+}
+
#ifdef DEBUG
string EvalObj::_debug_repr() {
return ext_repr();
@@ -163,7 +167,7 @@ string ProcObj::_debug_repr() { return ext_repr(); }
SpecialOptObj::SpecialOptObj() : OptObj() {}
-BoolObj::BoolObj(bool _val) : EvalObj(CLS_SIM_OBJ), val(_val) {}
+BoolObj::BoolObj(bool _val) : EvalObj(CLS_SIM_OBJ | CLS_BOOL_OBJ), val(_val) {}
bool BoolObj::is_true() { return val; }
@@ -242,7 +246,7 @@ Cons *BuiltinProcObj::call(ArgList *args, Environment * &envt,
Continuation * &cont, FrameObj ** &top_ptr) {
Cons *ret_addr = static_cast<RetAddr*>(*top_ptr)->addr;
- *top_ptr++ = handler(TO_CONS(args->cdr));
+ *top_ptr++ = handler(TO_CONS(args->cdr), name);
return ret_addr->next; // Move to the next instruction
}