diff options
author | Keith Packard <keithp@keithp.com> | 2017-12-19 11:33:36 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-12-19 11:33:36 -0800 |
commit | 431165e5fa72ba6dffd477de32960745cdec332c (patch) | |
tree | e27c174d5d6cea72caf92de3a4fe2c97e9249ddf /src/scheme/ao_scheme_make_const.c | |
parent | 5628b983497d9d03e10cccee157419210a49cfa9 (diff) |
altos/scheme: Rework display/write code
Unify output functions and add bool to switch between write and
display mode. Make that only affect strings (as per r⁷rs).
Use print recursion detection in frame and stack code, eliminating
PRINT flags in type field.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/scheme/ao_scheme_make_const.c')
-rw-r--r-- | src/scheme/ao_scheme_make_const.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scheme/ao_scheme_make_const.c b/src/scheme/ao_scheme_make_const.c index 51bb1269..79ba1bf1 100644 --- a/src/scheme/ao_scheme_make_const.c +++ b/src/scheme/ao_scheme_make_const.c @@ -220,7 +220,7 @@ ao_has_macro(ao_poly p) list = cons->cdr; p = AO_SCHEME_NIL; - while (list != AO_SCHEME_NIL && ao_scheme_poly_type(list) == AO_SCHEME_CONS) { + while (list != AO_SCHEME_NIL && AO_SCHEME_IS_CONS(list)) { cons = ao_scheme_poly_cons(list); m = ao_has_macro(cons->car); if (m) { @@ -280,7 +280,7 @@ ao_scheme_read_eval_abort(void) out = ao_scheme_eval(in); if (ao_scheme_exception) return 0; - ao_scheme_poly_write(out); + ao_scheme_poly_write(out, true); putchar ('\n'); } return 1; @@ -446,7 +446,7 @@ main(int argc, char **argv) if (val != AO_SCHEME_NIL) { printf("error: function %s contains unresolved macro: ", ao_scheme_poly_atom(vals->vals[f].atom)->name); - ao_scheme_poly_write(val); + ao_scheme_poly_write(val, true); printf("\n"); exit(1); } |