altos/lisp: Add floats
[fw/altos] / src / lisp / ao_lisp_cons.c
index 9379597ca82eb88ed6ae2866f2a11358cb4d7f6e..c70aa1caa0f70dacc4e3c86cdcd74fdd62c58965 100644 (file)
@@ -105,6 +105,19 @@ ao_lisp_cons_cons(ao_poly car, ao_poly cdr)
        return cons;
 }
 
+struct ao_lisp_cons *
+ao_lisp_cons_cdr(struct ao_lisp_cons *cons)
+{
+       ao_poly cdr = cons->cdr;
+       if (cdr == AO_LISP_NIL)
+               return NULL;
+       if (ao_lisp_poly_type(cdr) != AO_LISP_CONS) {
+               (void) ao_lisp_error(AO_LISP_INVALID, "improper list");
+               return NULL;
+       }
+       return ao_lisp_poly_cons(cdr);
+}
+
 ao_poly
 ao_lisp__cons(ao_poly car, ao_poly cdr)
 {