B:BD[
2.541] → [
2.541:965]
B:BD[
4.800] → [
4.800:810]
if let Some(cdr) = self.cdr.as_ref() {
matches!(cdr.as_ref(), Primitive::List(_))
} else {
// We are a list by virtue of resembling the empty list.
// Technically we have 2 representations of "empty list"
// - a cdr pointer of None (the pointed empty list)
// - a ConsCell with both car and cdr set to None (the object empty list)
true
}
// We have 2 ways of representing an "empty list" for Scheme
// - our cdr is pointed to None
// - our car and cdr are None (if this is so, *we are the empty list*
// and should technically not be considered for the "pair?" predicate)
self.cdr
.as_ref()
.is_some_and(|cdr| matches!(cdr.as_ref(), Primitive::List(_)))
|| self.cdr.is_none()