xo-interpreter2: + nil + cons

This commit is contained in:
Roland Conybeare 2026-03-11 16:19:40 -05:00
commit 87f08a4e4d
2 changed files with 24 additions and 4 deletions

View file

@ -17,7 +17,7 @@ namespace xo {
using xo::print::APrintable;
using xo::mm::AGCObject;
using xo::facet::FacetRegistry;
using xo::facet::typeseq;
//using xo::facet::typeseq;
namespace scm {
static DList s_null(obj<AGCObject>(), nullptr);
@ -28,6 +28,12 @@ namespace xo {
return &s_null;
}
obj<AGCObject,DList>
DList::nil()
{
return obj<AGCObject,DList>(_nil());
}
DList *
DList::_cons(obj<AAllocator> mm,
obj<AGCObject> car,
@ -38,6 +44,14 @@ namespace xo {
return new (mem) DList(car, cdr);
}
obj<AGCObject,DList>
DList::cons(obj<AAllocator> mm,
obj<AGCObject> car,
DList * cdr)
{
return obj<AGCObject,DList>(_cons(mm, car, cdr));
}
#ifdef OBSOLETE
DList *
DList::list(obj<AAllocator> mm,
@ -137,8 +151,6 @@ namespace xo {
obj<APrintable> elt
= FacetRegistry::instance().variant<APrintable, AGCObject>(l->head_);
assert(elt.data());
if (!pps->print_upto(elt))