summaryrefslogtreecommitdiff
path: root/src/scheme/ao_scheme_lambda.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-01-06 17:29:10 -0800
committerKeith Packard <keithp@keithp.com>2018-01-06 17:31:43 -0800
commit16061947d4376b41e596d87f97ec53ec29d17644 (patch)
treef7ad08f8810b0ea78cf282048eacb46d441a2ee1 /src/scheme/ao_scheme_lambda.c
parent39df849f0717d92a7d5bdf8aa5904bd4db1b467f (diff)
altos/scheme: Add ports. Split scheme code up.
And lots of other changes, including freeing unreferenced atoms. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/scheme/ao_scheme_lambda.c')
-rw-r--r--src/scheme/ao_scheme_lambda.c12
1 files changed, 6 insertions, 6 deletions
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