summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_lambda.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-18 19:04:05 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:52 -0800
commite600fc409c577eec02af612a36431c477a9c875e (patch)
tree6ad8dee3419084c6bfd90a93017aed0330c4e476 /src/lisp/ao_lisp_lambda.c
parent2cc8ca2b781be0a6e7ce14405eb4611bc00a3a3e (diff)
altos/lisp: Add continuations
This provides call/cc and makes 'stacks' visible to the application. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_lambda.c')
-rw-r--r--src/lisp/ao_lisp_lambda.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lisp/ao_lisp_lambda.c b/src/lisp/ao_lisp_lambda.c
index e2053a6f..656936cb 100644
--- a/src/lisp/ao_lisp_lambda.c
+++ b/src/lisp/ao_lisp_lambda.c
@@ -175,7 +175,8 @@ ao_lisp_lambda_eval(void)
args = ao_lisp_poly_cons(args->cdr);
vals = ao_lisp_poly_cons(vals->cdr);
}
- ao_lisp_cons_free(cons);
+ if (!ao_lisp_stack_marked(ao_lisp_stack))
+ ao_lisp_cons_free(cons);
cons = NULL;
break;
case AO_LISP_FUNC_LEXPR: