aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-08-08 11:07:40 +0800
committerTeddy <[email protected]>2013-08-08 11:07:40 +0800
commite50e8bff705beed1ecb41ab7b5336b39fc041056 (patch)
tree12d7aab8ec84bc5d674dc24d3e4ef2a9360a28fa
parentcff8072df5daba2c38ae2765af36cbb09da358f1 (diff)
fixed a bug in ProcObj::call
-rw-r--r--model.cpp6
1 files 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 "#<Symbol: " + val + ">"; }
+string SymObj::ext_repr() { return val; }
#ifdef DEBUG
-string SymObj::_debug_repr() { return ext_repr(); }
+string SymObj::_debug_repr() { return "#<Symbol: " + val + ">"; }
#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<SymObj*>(TO_CONS(ppar)->car), args->car);
}
- if (!ppar->is_cons_obj())
+ if (ppar->is_sym_obj())
_envt->add_binding(static_cast<SymObj*>(ppar), args->cdr); // (... . var_n)
else if (args->cdr != empty_list || ppar != empty_list)
throw TokenError("", RUN_ERR_WRONG_NUM_OF_ARGS);