aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index eae0597..68f6c33 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,10 +8,11 @@
#ifdef DEBUG
extern Cons *empty_list;
void tree_print(Cons *ptr) {
- if (!ptr || ptr == empty_list) return;
ptr->_debug_print();
- tree_print(dynamic_cast<Cons*>(ptr->car));
- tree_print(TO_CONS(ptr->cdr));
+ if (ptr->car->is_cons_obj())
+ tree_print(TO_CONS(ptr->car));
+ if (ptr->cdr->is_cons_obj())
+ tree_print(TO_CONS(ptr->cdr));
}
#endif