altos/lisp: convert GC to non-recursive
[fw/altos] / src / lisp / ao_lisp.h
index 27174e131997e06286eaab71ba6d13824a37827c..17f1e0f55540dbc5e55db4cfaf35ca0d3d1474b4 100644 (file)
@@ -173,6 +173,7 @@ enum ao_lisp_builtin_id {
        builtin_setq,
        builtin_cond,
        builtin_print,
+       builtin_patom,
        builtin_plus,
        builtin_minus,
        builtin_times,
@@ -220,6 +221,10 @@ ao_lisp_mem_round(int size)
 
 #define AO_LISP_OTHER_POLY(other) ((ao_poly)(other) + AO_LISP_OTHER)
 
+static inline int ao_lisp_poly_base_type(ao_poly poly) {
+       return poly & AO_LISP_TYPE_MASK;
+}
+
 static inline int ao_lisp_poly_type(ao_poly poly) {
        int     type = poly & AO_LISP_TYPE_MASK;
        if (type == AO_LISP_OTHER)
@@ -331,6 +336,9 @@ ao_lisp_cons_cons(ao_poly car, struct ao_lisp_cons *cdr);
 void
 ao_lisp_cons_print(ao_poly);
 
+void
+ao_lisp_cons_patom(ao_poly);
+
 /* string */
 extern const struct ao_lisp_type ao_lisp_string_type;
 
@@ -346,6 +354,9 @@ ao_lisp_string_cat(char *a, char *b);
 void
 ao_lisp_string_print(ao_poly s);
 
+void
+ao_lisp_string_patom(ao_poly s);
+
 /* atom */
 extern const struct ao_lisp_type ao_lisp_atom_type;
 
@@ -370,15 +381,18 @@ void
 ao_lisp_int_print(ao_poly i);
 
 /* prim */
-ao_poly
+void
 ao_lisp_poly_print(ao_poly p);
 
+void
+ao_lisp_poly_patom(ao_poly p);
+
 int
-ao_lisp_poly_mark(ao_poly p);
+ao_lisp_poly_mark(ao_poly p, uint8_t note_cons);
 
 /* returns 1 if the object has already been moved */
 int
-ao_lisp_poly_move(ao_poly *p);
+ao_lisp_poly_move(ao_poly *p, uint8_t note_cons);
 
 /* eval */