namespace lisp { variant function::operator()(context_ptr& ctx, variant& cns) { return f(ctx, cns); } const variant nil(cons_ptr(0)); const variant t(symbol("t")); }
uint64_t alm_dump_heap_item(ATERM t, int stack) { if (is_num(t)) printf("%18.1lf ", num_val(t)); else if (is_nil(t)) printf(" [] "); else if (is_cons(t)) { printf("<cons/0x%.3llX> ", (uint64_t)cons_ptr(t)); } else if (is_boxed(t)) { ATERM *box = boxed_ptr(t); if (is_atom(*box)) printf("<atom/0x%.3llX> ", (uint64_t)box); } else if (is_header(t)) { if (stack) printf("<fram/0x%.3llX> ",(uint64_t)frame_val(t)); else if (is_atom(t)) { printf("<atom/0x%.3llX> ",boxed_arity(t)); return boxed_arity(t)+1; } else printf("<frwd/0x%.3llX> ",(uint64_t)frame_val(t)); } return 1; }