diff options
author | Teddy <[email protected]> | 2013-08-09 12:41:49 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-09 12:41:49 +0800 |
commit | 01b2c905872ff38d5d8291f2f8de92c2771f183f (patch) | |
tree | bd3622d29d29cc1f7205a79eca9a15ee377c719a /model.cpp | |
parent | 0c606491335e99017897a7710461214412243dd7 (diff) |
removed `skip` field from Pair, use `next` to make jumps insteadskip_removal
Diffstat (limited to 'model.cpp')
-rw-r--r-- | model.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -89,9 +89,13 @@ string EvalObj::ext_repr() { { top_ptr--; obj = (*top_ptr)->next(""); - *(++top_ptr) = obj->get_repr_cons(); - if (hash.count((*top_ptr)->ori)) - *top_ptr = new ReprStr("#inf#"); + if (obj) + { + *(++top_ptr) = obj->get_repr_cons(); + if (hash.count((*top_ptr)->ori)) + *top_ptr = new ReprStr("#inf#"); + } + else *top_ptr = new ReprStr((*top_ptr)->repr); } top_ptr++; } @@ -102,7 +106,7 @@ string EvalObj::ext_repr() { } Pair::Pair(EvalObj *_car, EvalObj *_cdr) : - EvalObj(CLS_PAIR_OBJ), car(_car), cdr(_cdr), skip(false), + EvalObj(CLS_PAIR_OBJ), car(_car), cdr(_cdr), next(NULL) {} ReprCons *Pair::get_repr_cons() { |