diff options
Diffstat (limited to 'gruel/src/lib/pmt/pmt_io.cc')
-rw-r--r-- | gruel/src/lib/pmt/pmt_io.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gruel/src/lib/pmt/pmt_io.cc b/gruel/src/lib/pmt/pmt_io.cc index fbc556ab0..179e6b72c 100644 --- a/gruel/src/lib/pmt/pmt_io.cc +++ b/gruel/src/lib/pmt/pmt_io.cc @@ -80,20 +80,30 @@ pmt_write(pmt_t obj, std::ostream &port) port << "("; pmt_write_list_tail(obj, port); } - else if (pmt_is_dict(obj)){ - // FIXME - // port << "#<dict " << obj << ">"; - port << "#<dict>"; + else if (pmt_is_tuple(obj)){ + port << "{"; + size_t len = pmt_length(obj); + if (len > 0){ + port << pmt_tuple_ref(obj, 0); + for (size_t i = 1; i < len; i++) + port << " " << pmt_tuple_ref(obj, i); + } + port << "}"; } else if (pmt_is_vector(obj)){ - // FIXME - // port << "#<vector " << obj << ">"; - port << "#<vector>"; + port << "#("; + size_t len = pmt_length(obj); + if (len > 0){ + port << pmt_vector_ref(obj, 0); + for (size_t i = 1; i < len; i++) + port << " " << pmt_vector_ref(obj, i); + } + port << ")"; } - else if (pmt_is_tuple(obj)){ + else if (pmt_is_dict(obj)){ // FIXME - // port << "#<tuple " << obj << ">"; - port << "#<tuple>"; + // port << "#<dict " << obj << ">"; + port << "#<dict>"; } else if (pmt_is_uniform_vector(obj)){ // FIXME |