xo-objectd2 xo-printable xo-facet: pp working for List(Integer)
Also streamline facet switching
This commit is contained in:
parent
d5e1e6290b
commit
148d5e9ca0
13 changed files with 379 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue