+ao_poly
+ao_lisp_atom_def(ao_poly atom, ao_poly val)
+{
+ ao_poly *ref = ao_lisp_atom_ref(atom);
+
+ if (ref) {
+ if (ao_lisp_frame_current)
+ return ao_lisp_error(AO_LISP_REDEFINED, "attempt to redefine atom %s", ao_lisp_poly_atom(atom)->name);
+ *ref = val;
+ return val;
+ }
+ return ao_lisp_frame_add(ao_lisp_frame_current ? ao_lisp_frame_current : ao_lisp_frame_global, atom, val);
+}
+