print improvements

This commit is contained in:
JeffBezanson 2010-05-04 23:54:07 +00:00
parent 271cf34e99
commit 3bac64cbd7
2 changed files with 14 additions and 2 deletions

View File

@ -168,7 +168,8 @@ static inline int tinyp(value_t v)
return (u8_strwidth(symbol_name(v)) < SMALL_STR_LEN);
if (fl_isstring(v))
return (cv_len((cvalue_t*)ptr(v)) < SMALL_STR_LEN);
return (isfixnum(v) || isbuiltin(v));
return (isfixnum(v) || isbuiltin(v) || v==FL_F || v==FL_T || v==FL_NIL ||
v == FL_EOF);
}
static int smallp(value_t v)
@ -757,5 +758,8 @@ void fl_print(ios_t *f, value_t v)
memset(consflags, 0, 4*bitvector_nwords(heapsize/sizeof(cons_t)));
}
htable_reset(&printconses, 32);
if ((iscons(v) || isvector(v) || isfunction(v) || iscvalue(v)) &&
!fl_isstring(v) && v!=FL_T && v!=FL_F && v!=FL_NIL) {
htable_reset(&printconses, 32);
}
}

View File

@ -1189,3 +1189,11 @@ what needs more test coverage:
- bitwise and logical ops
- making a closure in a default value expression for an optional arg
- gc during a catch block, then get stack trace
-----------------------------------------------------------------------------
5/4/10 todo:
- flush and close open files on exit
- make function versions of opcode builtins by wrapping in a lambda,
stored in a table indexed by opcode. use in _applyn