mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 07:47:39 +02:00
Issue #90 - Check for cdr
being a value type
Also cleaned up the display/write pair printing code a bit by using Cyc_is_pair.
This commit is contained in:
parent
4595e85f5e
commit
bb2a3bb031
1 changed files with 2 additions and 2 deletions
|
@ -751,7 +751,7 @@ object Cyc_display(object x, FILE * port)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = cdr(x); tmp && ((closure) tmp)->tag == pair_tag; tmp = cdr(tmp)) {
|
for (tmp = cdr(x); Cyc_is_pair(tmp) == boolean_t; tmp = cdr(tmp)) {
|
||||||
if (has_cycle == boolean_t) {
|
if (has_cycle == boolean_t) {
|
||||||
if (i++ > 20)
|
if (i++ > 20)
|
||||||
break; /* arbitrary number, for now */
|
break; /* arbitrary number, for now */
|
||||||
|
@ -875,7 +875,7 @@ static object _Cyc_write(object x, FILE * port)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (tmp = cdr(x); tmp && !is_value_type(tmp) && ((closure) tmp)->tag == pair_tag; tmp = cdr(tmp)) {
|
for (tmp = cdr(x); Cyc_is_pair(tmp) == boolean_t; tmp = cdr(tmp)) {
|
||||||
if (has_cycle == boolean_t) {
|
if (has_cycle == boolean_t) {
|
||||||
if (i++ > 20)
|
if (i++ > 20)
|
||||||
break; /* arbitrary number, for now */
|
break; /* arbitrary number, for now */
|
||||||
|
|
Loading…
Add table
Reference in a new issue