xo-objectd2 xo-printable xo-facet: pp working for List(Integer)

Also streamline facet switching
This commit is contained in:
Roland Conybeare 2026-01-09 17:48:54 -05:00
commit 09ee3a20ac
23 changed files with 508 additions and 27 deletions

View file

@ -19,18 +19,28 @@ namespace xo {
static DList s_null(obj<AGCObject>(), nullptr);
DList *
DList::null()
DList::_nil()
{
return &s_null;
}
DList *
DList::_cons(obj<AAllocator> mm,
obj<AGCObject> car,
DList * cdr)
{
void * mem = mm.alloc(typeseq::id<DList>(), sizeof(DList));
return new (mem) DList(car, cdr);
}
DList *
DList::list(obj<AAllocator> mm,
obj<AGCObject> h1)
{
void * mem = mm.alloc(typeseq::id<DList>(), sizeof(DList));
return new (mem) DList(h1, DList::null());
return new (mem) DList(h1, DList::_nil());
}
DList *
@ -112,7 +122,8 @@ namespace xo {
obj<APrintable> elt
= FacetRegistry::instance().variant<APrintable, AGCObject>(l->head_);
// what if no converter registered ?
assert(elt);
if (!pps->print_upto(elt))
return false;