altos/lisp: Fix some scheme compat issues
[fw/altos] / src / lisp / ao_lisp_string.c
index 87f9289cbd148b45a53de3200b0a8bd56518b07a..1daa50ea968f70ec211e9d487367ad7a58524aa3 100644 (file)
@@ -83,9 +83,9 @@ ao_lisp_string_pack(struct ao_lisp_cons *cons)
        char    *s = r;
 
        while (cons) {
-               if (ao_lisp_poly_type(cons->car) != AO_LISP_INT)
+               if (!ao_lisp_integer_typep(ao_lisp_poly_type(cons->car)))
                        return ao_lisp_error(AO_LISP_INVALID, "non-int passed to pack");
-               *s++ = ao_lisp_poly_int(cons->car);
+               *s++ = ao_lisp_poly_integer(cons->car);
                cons = ao_lisp_poly_cons(cons->cdr);
        }
        *s++ = 0;
@@ -140,7 +140,10 @@ ao_lisp_string_write(ao_poly p)
                        printf ("\\t");
                        break;
                default:
-                       putchar(c);
+                       if (c < ' ')
+                               printf("\\%03o", c);
+                       else
+                               putchar(c);
                        break;
                }
        }