diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |