+struct ao_lisp_cons *ao_lisp_read_cons;
+struct ao_lisp_cons *ao_lisp_read_cons_tail;
+struct ao_lisp_cons *ao_lisp_read_stack;
+
+static int
+push_read_stack(int cons, int in_quote)
+{
+ DBGI("push read stack %p %d\n", ao_lisp_read_cons, in_quote);
+ DBG_IN();
+ if (cons) {
+ ao_lisp_read_stack = ao_lisp_cons_cons(ao_lisp_cons_poly(ao_lisp_read_cons),
+ ao_lisp_cons_cons(ao_lisp_int_poly(in_quote),
+ ao_lisp_read_stack));
+ if (!ao_lisp_read_stack)
+ return 0;
+ }
+ ao_lisp_read_cons = NULL;
+ ao_lisp_read_cons_tail = NULL;
+ return 1;
+}
+
+static int
+pop_read_stack(int cons)
+{
+ int in_quote = 0;
+ if (cons) {
+ ao_lisp_read_cons = ao_lisp_poly_cons(ao_lisp_read_stack->car);
+ ao_lisp_read_stack = ao_lisp_poly_cons(ao_lisp_read_stack->cdr);
+ in_quote = ao_lisp_poly_int(ao_lisp_read_stack->car);
+ ao_lisp_read_stack = ao_lisp_poly_cons(ao_lisp_read_stack->cdr);
+ for (ao_lisp_read_cons_tail = ao_lisp_read_cons;
+ ao_lisp_read_cons_tail && ao_lisp_read_cons_tail->cdr;
+ ao_lisp_read_cons_tail = ao_lisp_poly_cons(ao_lisp_read_cons_tail->cdr))
+ ;
+ } else {
+ ao_lisp_read_cons = 0;
+ ao_lisp_read_cons_tail = 0;
+ ao_lisp_read_stack = 0;
+ }
+ DBG_OUT();
+ DBGI("pop read stack %p %d\n", ao_lisp_read_cons, in_quote);
+ return in_quote;
+}
+
+ao_poly
+ao_lisp_read(void)