altos/lisp: Rename progn to begin
[fw/altos] / src / lisp / ao_lisp_stack.c
index 9c773e83cef3cf95a61aa14fda5cccd4bce73135..9d6cccc41f61175f486e7f65b90378da95c2c81c 100644 (file)
@@ -12,7 +12,6 @@
  * General Public License for more details.
  */
 
-#define DBG_EVAL 0
 #include "ao_lisp.h"
 
 const struct ao_lisp_type ao_lisp_stack_type;
@@ -157,18 +156,18 @@ ao_lisp_stack_clear(void)
 }
 
 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);
@@ -242,7 +241,7 @@ ao_lisp_stack_eval(void)
  * 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;
@@ -274,6 +273,6 @@ ao_lisp_call_cc(struct ao_lisp_cons *cons)
        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;
 }