aboutsummaryrefslogtreecommitdiff
path: root/eval.cpp
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-11 13:05:51 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-11 13:05:51 +0800
commit81844497e621997c527ceedd722854966bd098e0 (patch)
tree4bc16a4100e1c330e558fdc975a113d272567b86 /eval.cpp
parent448ac0bcc3a81e250a825c333dd01c77e754341a (diff)
fixed `next` pointer and `ext_repr` issues
Diffstat (limited to 'eval.cpp')
-rw-r--r--eval.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/eval.cpp b/eval.cpp
index 0b9150e..6376ba9 100644
--- a/eval.cpp
+++ b/eval.cpp
@@ -102,7 +102,7 @@ void push(Pair * &pc, FrameObj ** &top_ptr, Environment *envt) {
throw NormalError(SYN_ERR_EMPTY_COMB);
*top_ptr++ = new RetAddr(pc); // Push the return address
- if (!is_list(TO_PAIR(pc->car)))
+ if (!make_exec(TO_PAIR(pc->car)))
throw TokenError(pc->car->ext_repr(), RUN_ERR_WRONG_NUM_OF_ARGS);
// static_cast because of is_simple_obj() is false
pc = static_cast<Pair*>(pc->car); // Go deeper to enter the call
@@ -121,7 +121,6 @@ EvalObj *Evaluator::run_expr(Pair *prog) {
{
if (top_ptr == eval_stack + EVAL_STACK_SIZE)
throw TokenError("Evaluation", RUN_ERR_STACK_OVERFLOW);
-// for (; pc && pc->skip; pc = pc->next);
if (pc)
push(pc, top_ptr, envt);
else