altos/lisp: add progn, while, read and eval
[fw/altos] / src / lisp / ao_lisp_string.c
index 1ab569332cc378a05d24a2dac63f865d2bb81d8c..0064064cfe07cfc22730b7ac1f369b5240a23633 100644 (file)
@@ -68,16 +68,18 @@ ao_lisp_string_cat(char *a, char *b)
        return r;
 }
 
-const struct ao_lisp_mem_type ao_lisp_string_type = {
+const struct ao_lisp_type ao_lisp_string_type = {
        .mark = string_mark,
        .size = string_size,
        .move = string_move,
 };
 
 void
-ao_lisp_string_print(char *s)
+ao_lisp_string_print(ao_poly p)
 {
+       char    *s = ao_lisp_poly_string(p);
        char    c;
+
        putchar('"');
        while ((c = *s++)) {
                switch (c) {
@@ -97,3 +99,13 @@ ao_lisp_string_print(char *s)
        }
        putchar('"');
 }
+
+void
+ao_lisp_string_patom(ao_poly p)
+{
+       char    *s = ao_lisp_poly_string(p);
+       char    c;
+
+       while ((c = *s++))
+               putchar(c);
+}