/// A VM value not attached to a particular VM instance
#[derive(Debug, Clone)]
#[allow(missing_docs)]
pub enum FreePrimitive<'a> {
List(FreeListCell<'a>),
Vector(Vec<FreePrimitive<'a>>),
Bytevector(Vec<u8>),
Integer(i64),
Float(f64),
String(Rc<str>),
// As we don't know the target symbol table,
// externalized symbols are represented by their symbol text
Symbol(Rc<str>),
Bool(bool),
// TODO How can users *extract* what's in a PrimitiveBox.
// - the type they want to extract as *must* implement Clone to get it out of the box
Data(Rc<PrimitiveBox>),
}
/// A [`ListCell`] that is not attached to a VM instance
#[derive(Debug, Clone)]
pub enum FreeListCell<'a> {
/// The empty list
Null,
/// A list with a single element
Leaf(&'a FreePrimitive<'a>),
/// A pair of list cells
Cons(&'a FreeListCell<'a>, &'a FreeListCell<'a>),
}