pub fn core_pop(&mut self, chunk: &Chunk, i: usize) -> i32 {
        if self.stack.len() < 1 {
            print_error(chunk, i, "pop requires one argument");
            return 0;
        }

        let lst_rr = self.stack.pop().unwrap();
        let element_rr = match *(lst_rr.borrow_mut()) {
            Value::List(ref mut lst) => {
                let element_rr_opt = lst.pop_back();
                match element_rr_opt {
                    Some(element_rr) => element_rr,
                    None => Rc::new(RefCell::new(Value::Null)),
                }
            }
            _ => {
                print_error(chunk, i, "pop argument must be list");
                return 0;
            }
        };

        self.stack.push(element_rr);
        return 1;
    }
/// Takes a list as its single argument.  Pops a value from the
/// end of the list and places that value onto the stack.
Takes a list as its single argument.  Pops a value from the
end of the list and places that value onto the stack.
Takes a list as its single argument . Pops a value from the end of the list and places that value onto the stack .
pub fn core_pop(&mut self, chunk: &Chunk, i: usize) -> i32 {
        if self.stack.len() < 1 {
            print_error(chunk, i, "pop requires one argument");
            return 0;
        }
        let lst_rr = self.stack.pop().unwrap();
        let element_rr = match *(lst_rr.borrow_mut()) {
            Value::List(ref mut lst) => {
                let element_rr_opt = lst.pop_back();
                match element_rr_opt {
                    Some(element_rr) => element_rr,
                    None => Rc::new(RefCell::new(Value::Null)),
                }
            }
            _ => {
                print_error(chunk, i, "pop argument must be list");
                return 0;
            }
        };
        self.stack.push(element_rr);
        return 1;
    }
pub fn core_pop ( & mut self , chunk : & Chunk , i : usize ) -> i32 { if self . stack . len ( ) < 1 { print_error ( chunk , i , " " ) ; return 0 ; } let lst_rr = self . stack . pop ( ) . unwrap ( ) ; let element_rr = match * ( lst_rr . borrow_mut ( ) ) { Value :: List ( ref mut lst ) => { let element_rr_opt = lst . pop_back ( ) ; match element_rr_opt { Some ( element_rr ) => element_rr , None => Rc :: new ( RefCell :: new ( Value :: Null ) ) , } } _ => { print_error ( chunk , i , " " ) ; return 0 ; } } ; self . stack . push ( element_rr ) ; return 1 ; }
Takes a list as its single argument.
Takes a list as its single argument .
&mut self
chunk
&Chunk
i
usize