From 3406f0a979e2465a993b20c2eb1033729c6a787c Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 6 Aug 2013 19:11:22 +0800 Subject: added and restructured built-in procedures --- model.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'model.cpp') 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(*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 } -- cgit v1.2.3