diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-05 17:53:15 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-02-20 11:16:50 -0800 |
commit | d8cf97fe22acefab40d7bb321138e46d4483fef7 (patch) | |
tree | 8dbab3f6977c62aa16208913013b3bd0d0728817 /src/lisp/ao_lisp_builtin.c | |
parent | 286d07d83bd7ff361e5a904c151a75e5a9c8b071 (diff) |
altos/lisp: more GC issues. add patom
Use global ao_lisp_stack instead of local stack so that gc
moves of that item work.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_builtin.c')
-rw-r--r-- | src/lisp/ao_lisp_builtin.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lisp/ao_lisp_builtin.c b/src/lisp/ao_lisp_builtin.c index 0ad1f464..49b6c37d 100644 --- a/src/lisp/ao_lisp_builtin.c +++ b/src/lisp/ao_lisp_builtin.c @@ -180,6 +180,18 @@ ao_lisp_print(struct ao_lisp_cons *cons) } ao_poly +ao_lisp_patom(struct ao_lisp_cons *cons) +{ + ao_poly val = AO_LISP_NIL; + while (cons) { + val = cons->car; + ao_lisp_poly_patom(val); + cons = ao_lisp_poly_cons(cons->cdr); + } + return val; +} + +ao_poly ao_lisp_math(struct ao_lisp_cons *cons, enum ao_lisp_builtin_id op) { ao_poly ret = AO_LISP_NIL; @@ -376,6 +388,7 @@ ao_lisp_func_t ao_lisp_builtins[] = { [builtin_setq] = ao_lisp_setq, [builtin_cond] = ao_lisp_cond, [builtin_print] = ao_lisp_print, + [builtin_patom] = ao_lisp_patom, [builtin_plus] = ao_lisp_plus, [builtin_minus] = ao_lisp_minus, [builtin_times] = ao_lisp_times, |