pub fn from_class(class: SOMRef<Class>) -> Self {
        let mut locals = Vec::new();

        fn collect_locals(class: &SOMRef<Class>, locals: &mut Vec<Value>) {
            if let Some(class) = class.borrow().super_class() {
                collect_locals(&class, locals);
            }
            locals.extend(class.borrow().locals.iter().map(|_| Value::Nil));
        }

        collect_locals(&class, &mut locals);

        // let locals = class.borrow().locals.iter().map(|_| Value::Nil).collect();

        Self { class, locals }
    }
/// Construct an instance for a given class.
Construct an instance for a given class.
Construct an instance for a given class .
pub fn from_class(class: SOMRef<Class>) -> Self {
        let mut locals = Vec::new();
        fn collect_locals(class: &SOMRef<Class>, locals: &mut Vec<Value>) {
            if let Some(class) = class.borrow().super_class() {
                collect_locals(&class, locals);
            }
            locals.extend(class.borrow().locals.iter().map(|_| Value::Nil));
        }
        collect_locals(&class, &mut locals);
        // let locals = class.borrow().locals.iter().map(|_| Value::Nil).collect();
        Self { class, locals }
    }
pub fn from_class ( class : SOMRef < Class > ) -> Self { let mut locals = Vec :: new ( ) ; fn collect_locals ( class : & SOMRef < Class > , locals : & mut Vec < Value > ) { if let Some ( class ) = class . borrow ( ) . super_class ( ) { collect_locals ( & class , locals ) ; } locals . extend ( class . borrow ( ) . locals . iter ( ) . map ( | _ | Value :: Nil ) ) ; } collect_locals ( & class , & mut locals ) ; // let locals = class.borrow().locals.iter().map(|_| Value::Nil).collect(); Self { class , locals } }
Construct an instance for a given class.
Construct an instance for a given class .
class
SOMRef<Class>