From 16061947d4376b41e596d87f97ec53ec29d17644 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 6 Jan 2018 17:29:10 -0800 Subject: altos/scheme: Add ports. Split scheme code up. And lots of other changes, including freeing unreferenced atoms. Signed-off-by: Keith Packard --- src/scheme/ao_scheme_lambda.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/scheme/ao_scheme_lambda.c') diff --git a/src/scheme/ao_scheme_lambda.c b/src/scheme/ao_scheme_lambda.c index e818d7b0..18470efe 100644 --- a/src/scheme/ao_scheme_lambda.c +++ b/src/scheme/ao_scheme_lambda.c @@ -50,19 +50,19 @@ const struct ao_scheme_type ao_scheme_lambda_type = { }; void -ao_scheme_lambda_write(ao_poly poly, bool write) +ao_scheme_lambda_write(FILE *out, ao_poly poly, bool write) { struct ao_scheme_lambda *lambda = ao_scheme_poly_lambda(poly); struct ao_scheme_cons *cons = ao_scheme_poly_cons(lambda->code); - printf("("); - printf("%s", ao_scheme_args_name(lambda->args)); + putc('(', out); + fputs(ao_scheme_args_name(lambda->args), out); while (cons) { - printf(" "); - ao_scheme_poly_write(cons->car, write); + putc(' ', out); + ao_scheme_poly_write(out, cons->car, write); cons = ao_scheme_poly_cons(cons->cdr); } - printf(")"); + putc(')', out); } static ao_poly -- cgit v1.2.3