pub fn core_pwd(&mut self, chunk: &Chunk, i: usize) -> i32 {
        let current_dir_res = std::env::current_dir();
        match current_dir_res {
            Ok(current_dir) => {
                self.stack.push(Rc::new(RefCell::new(Value::String(
                    current_dir.to_str().unwrap().to_string(),
                    None,
                ))));
            }
            Err(e) => {
                let err_str = format!("unable to pwd: {}", e.to_string());
                print_error(chunk, i, &err_str);
                return 0;
            }
        }
        return 1;
    }
/// Puts the string representation of the current working
/// directory onto the stack.
Puts the string representation of the current working
directory onto the stack.
Puts the string representation of the current working directory onto the stack .
pub fn core_pwd(&mut self, chunk: &Chunk, i: usize) -> i32 {
        let current_dir_res = std::env::current_dir();
        match current_dir_res {
            Ok(current_dir) => {
                self.stack.push(Rc::new(RefCell::new(Value::String(
                    current_dir.to_str().unwrap().to_string(),
                    None,
                ))));
            }
            Err(e) => {
                let err_str = format!("unable to pwd: {}", e.to_string());
                print_error(chunk, i, &err_str);
                return 0;
            }
        }
        return 1;
    }
pub fn core_pwd ( & mut self , chunk : & Chunk , i : usize ) -> i32 { let current_dir_res = std :: env :: current_dir ( ) ; match current_dir_res { Ok ( current_dir ) => { self . stack . push ( Rc :: new ( RefCell :: new ( Value :: String ( current_dir . to_str ( ) . unwrap ( ) . to_string ( ) , None , ) ) ) ) ; } Err ( e ) => { let err_str = format ! ( " " e to_string ( ) ) ; print_error ( chunk , i , & err_str ) ; return 0 ; } } return 1 ; }
Puts the string representation of the current working
directory onto the stack.
Puts the string representation of the current working directory onto the stack .
&mut self
chunk
&Chunk
i
usize