int
ao_lisp_stack_push(void)
{
- struct ao_lisp_stack *stack = ao_lisp_stack_new();
+ struct ao_lisp_stack *stack;
+
+ stack = ao_lisp_stack_new();
if (!stack)
return 0;
}
void
-ao_lisp_stack_print(ao_poly poly)
+ao_lisp_stack_write(ao_poly poly)
{
struct ao_lisp_stack *s = ao_lisp_poly_stack(poly);
- if (s->type & AO_LISP_STACK_PRINT) {
- printf("[recurse...]");
- return;
- }
while (s) {
+ if (s->type & AO_LISP_STACK_PRINT) {
+ printf("[recurse...]");
+ return;
+ }
s->type |= AO_LISP_STACK_PRINT;
printf("\t[\n");
- printf("\t\texpr: "); ao_lisp_poly_print(s->list); printf("\n");
+ printf("\t\texpr: "); ao_lisp_poly_write(s->list); printf("\n");
printf("\t\tstate: %s\n", ao_lisp_state_names[s->state]);
ao_lisp_error_poly ("values: ", s->values, s->values_tail);
ao_lisp_error_poly ("sexprs: ", s->sexprs, AO_LISP_NIL);
* it a single argument which is the current continuation
*/
ao_poly
-ao_lisp_call_cc(struct ao_lisp_cons *cons)
+ao_lisp_do_call_cc(struct ao_lisp_cons *cons)
{
struct ao_lisp_stack *new;
ao_poly v;
cons->cdr = AO_LISP_NIL;
v = ao_lisp_lambda_eval();
ao_lisp_stack->sexprs = v;
- ao_lisp_stack->state = eval_progn;
+ ao_lisp_stack->state = eval_begin;
return AO_LISP_NIL;
}