RNXGJRK6TBSCXACJQ4RQXEYWPL7PJFUPYC7FWN5RNACKPWQYU4NAC
write!(
f,
"#<{}>",
self.inner
.as_debug()
.map(|d| format!("{:?}", d))
.unwrap_or_else(|| format!("primitive {}", self.inner.type_name()))
)
if let Some(datum) = self.as_datum() {
_ = datum;
// The debug representation is the print of the datum
todo!()
} else {
write!(
f,
"#<{}>",
self.inner
.as_debug()
.map(|d| format!("{:?}", d))
.unwrap_or_else(|| format!("primitive {}", self.inner.type_name()))
)
}
// TODO Change Debug to output datum representation
// Null -> ()
// Leaf(prim) -> <Debug of prim>
// Cons(car, cdr) -> (<Debug of car> <spliced Debug of cdr>)
// We might have a special "DebugCdr" struct just to handle the debug printing of cdr
// We will *definitely* need a helper "CycleIter" that can iterate through (possibly)
// cyclical datstructures
// TODO handle ports (they must be able to write/read from garbage-collected bytevectors)