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

        let value_rr = self.stack.pop().unwrap();
        let value_rrb = value_rr.borrow();
        let res = match *value_rrb {
            Value::List(_) => 1,
            Value::Generator(_, _, _, _, _, _, _) => 1,
            Value::CommandGenerator(_) => 1,
            Value::KeysGenerator(_, _) => 1,
            Value::ValuesGenerator(_, _) => 1,
            Value::EachGenerator(_, _) => 1,
            _ => 0,
        };
        self.stack.push(Rc::new(RefCell::new(Value::Int(res))));
        return 1;
    }
/// Takes an arbitrary value as its single argument.  Places a
/// boolean onto the stack indicating whether the argument can be
/// shifted.
Takes an arbitrary value as its single argument.  Places a
boolean onto the stack indicating whether the argument can be
shifted.
Takes an arbitrary value as its single argument . Places a boolean onto the stack indicating whether the argument can be shifted .
pub fn opcode_isshiftable(&mut self, chunk: &Chunk, i: usize) -> i32 {
        if self.stack.len() < 1 {
            print_error(chunk, i, "is-shiftable requires one argument");
            return 0;
        }
        let value_rr = self.stack.pop().unwrap();
        let value_rrb = value_rr.borrow();
        let res = match *value_rrb {
            Value::List(_) => 1,
            Value::Generator(_, _, _, _, _, _, _) => 1,
            Value::CommandGenerator(_) => 1,
            Value::KeysGenerator(_, _) => 1,
            Value::ValuesGenerator(_, _) => 1,
            Value::EachGenerator(_, _) => 1,
            _ => 0,
        };
        self.stack.push(Rc::new(RefCell::new(Value::Int(res))));
        return 1;
    }
pub fn opcode_isshiftable ( & mut self , chunk : & Chunk , i : usize ) -> i32 { if self . stack . len ( ) < 1 { print_error ( chunk , i , " " ) ; return 0 ; } let value_rr = self . stack . pop ( ) . unwrap ( ) ; let value_rrb = value_rr . borrow ( ) ; let res = match * value_rrb { Value :: List ( _ ) => 1 , Value :: Generator ( _ , _ , _ , _ , _ , _ , _ ) => 1 , Value :: CommandGenerator ( _ ) => 1 , Value :: KeysGenerator ( _ , _ ) => 1 , Value :: ValuesGenerator ( _ , _ ) => 1 , Value :: EachGenerator ( _ , _ ) => 1 , _ => 0 , } ; self . stack . push ( Rc :: new ( RefCell :: new ( Value :: Int ( res ) ) ) ) ; return 1 ; }
Takes an arbitrary value as its single argument.
Takes an arbitrary value as its single argument .
&mut self
chunk
&Chunk
i
usize