pub fn to_vec(&self) -> Option<Vec<CellRef>> {
        if let SafasCell::List(car, cdr) = self {
            let mut result = vec![];
            result.push(Arc::clone(car));

            let mut pos = cdr;
            while let SafasCell::List(car, cdr) = &**pos {
                result.push(Arc::clone(car));
                pos = cdr;
            }

            Some(result)
        } else if self.is_nil() {
            // Nil is the same as the empty list
            Some(vec![])
        } else {
            // Not a list
            None
        }
    }
///
/// If this cell represents a list, returns a vec of the items in the list
/// 
/// Returns None if the cell is not a list
///
If this cell represents a list, returns a vec of the items in the list
Returns None if the cell is not a list
If this cell represents a list returns a vec of the items in the list Returns None if the cell is not a list
pub fn to_vec(&self) -> Option<Vec<CellRef>> {
        if let SafasCell::List(car, cdr) = self {
            let mut result = vec![];
            result.push(Arc::clone(car));
            let mut pos = cdr;
            while let SafasCell::List(car, cdr) = &**pos {
                result.push(Arc::clone(car));
                pos = cdr;
            }
            Some(result)
        } else if self.is_nil() {
            // Nil is the same as the empty list
            Some(vec![])
        } else {
            // Not a list
            None
        }
    }
pub fn to_vec ( & self ) -> Option < Vec < CellRef > > { if let SafasCell :: List ( car , cdr ) = self { let mut result = vec ! [ ] ; result . push ( Arc :: clone ( car ) ) ; let mut pos = cdr ; while let SafasCell :: List ( car , cdr ) = & * * pos { result . push ( Arc :: clone ( car ) ) ; pos = cdr ; } Some ( result ) } else if self . is_nil ( ) { // Nil is the same as the empty list Some ( vec ! [ ] ) } else { // Not a list None } }
If this cell represents a list, returns a vec of the items in the list
Returns None if the cell is not a list
If this cell represents a list returns a vec of the items in the list Returns None if the cell is not a list
&self
&self