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_int.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_int.c')
-rw-r--r-- | src/scheme/ao_scheme_int.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/scheme/ao_scheme_int.c b/src/scheme/ao_scheme_int.c index 4fcf4931..01b571c0 100644 --- a/src/scheme/ao_scheme_int.c +++ b/src/scheme/ao_scheme_int.c @@ -15,9 +15,10 @@ #include "ao_scheme.h" void -ao_scheme_int_write(ao_poly p) +ao_scheme_int_write(ao_poly p, bool write) { int i = ao_scheme_poly_int(p); + (void) write; printf("%d", i); } @@ -76,10 +77,11 @@ const struct ao_scheme_type ao_scheme_bigint_type = { }; void -ao_scheme_bigint_write(ao_poly p) +ao_scheme_bigint_write(ao_poly p, bool write) { struct ao_scheme_bigint *bi = ao_scheme_poly_bigint(p); + (void) write; printf("%d", bi->value); } #endif /* AO_SCHEME_FEATURE_BIGINT */ |