From e50e8bff705beed1ecb41ab7b5336b39fc041056 Mon Sep 17 00:00:00 2001 From: Teddy Date: Thu, 8 Aug 2013 11:07:40 +0800 Subject: fixed a bug in ProcObj::call --- model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model.cpp b/model.cpp index 8ffc019..389f657 100644 --- a/model.cpp +++ b/model.cpp @@ -123,10 +123,10 @@ string UnspecObj::_debug_repr() { return ext_repr(); } SymObj::SymObj(const string &str) : EvalObj(CLS_SIM_OBJ | CLS_SYM_OBJ), val(str) {} -string SymObj::ext_repr() { return "#"; } +string SymObj::ext_repr() { return val; } #ifdef DEBUG -string SymObj::_debug_repr() { return ext_repr(); } +string SymObj::_debug_repr() { return "#"; } #endif OptObj::OptObj() : EvalObj(CLS_SIM_OBJ | CLS_OPT_OBJ) {} @@ -156,7 +156,7 @@ Cons *ProcObj::call(ArgList *args, Environment * &genvt, _envt->add_binding(static_cast(TO_CONS(ppar)->car), args->car); } - if (!ppar->is_cons_obj()) + if (ppar->is_sym_obj()) _envt->add_binding(static_cast(ppar), args->cdr); // (... . var_n) else if (args->cdr != empty_list || ppar != empty_list) throw TokenError("", RUN_ERR_WRONG_NUM_OF_ARGS); -- cgit v1.2.3-70-g09d2