diff --git a/src/object2/DList.cpp b/src/object2/DList.cpp index 65b18a6..8d851e7 100644 --- a/src/object2/DList.cpp +++ b/src/object2/DList.cpp @@ -4,11 +4,15 @@ **/ #include "DList.hpp" +#include +#include #include #include namespace xo { + using xo::print::APrintable; using xo::mm::AGCObject; + using xo::facet::FacetRegistry; using xo::facet::typeseq; namespace scm { @@ -96,17 +100,28 @@ namespace xo { if (ppii.upto()) { /* perhaps print on one line */ - if (!pps->print_upto("(...)")) - return false; + pps->write("("); -#ifdef NOT_YET /* TODO: probably use iterators here, when available */ const DList * l = this; - while (!l->is_empty()) { - obj(l->head_.data()); + size_t i = 0; + while (!l->is_empty()) { + if (i > 0) + pps->write(" "); + + obj elt + = FacetRegistry::instance().variant(l->head_); + // what if no converter registered ? + + if (!pps->print_upto(elt)) + return false; + + l = l->rest_; + ++i; } -#endif + + pps->write(")"); return true; } else { pps->write("(...)");