summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_make_const.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-10 23:24:11 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:50 -0800
commitfb710f7f4f24f74ac3d45fcc423803384d986bb2 (patch)
tree0b12ad61291860d12cc3f2e41d9e19eb73914975 /src/lisp/ao_lisp_make_const.c
parentc7d7cdc2318a97534c4c1f9c6fd2b51644be729d (diff)
altos/lisp: use regular read-eval-print loop for make const
No need to open code this sequence of operations. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_make_const.c')
-rw-r--r--src/lisp/ao_lisp_make_const.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/lisp/ao_lisp_make_const.c b/src/lisp/ao_lisp_make_const.c
index bb4afbfb..4fc43e58 100644
--- a/src/lisp/ao_lisp_make_const.c
+++ b/src/lisp/ao_lisp_make_const.c
@@ -105,20 +105,12 @@ main(int argc, char **argv)
ao_lisp_atom_set(ao_lisp_atom_poly(a),
ao_lisp_atom_poly(a));
- for (;;) {
- sexpr = ao_lisp_read();
- if (!sexpr)
- break;
- printf ("sexpr: ");
- ao_lisp_poly_print(sexpr);
- printf("\n");
- val = ao_lisp_eval(sexpr);
- if (ao_lisp_exception)
- exit(1);
- printf("\t");
- ao_lisp_poly_print(val);
- printf("\n");
- }
+ /* end of file value */
+ a = ao_lisp_atom_intern("eof");
+ ao_lisp_atom_set(ao_lisp_atom_poly(a),
+ ao_lisp_atom_poly(a));
+
+ ao_lisp_read_eval_print();
/* Reduce to referenced values */
ao_lisp_collect();