pub struct Env { /* private fields */ }
Expand description
An environment of symbol bindings. Used for the base environment, for
closures, for let
statements, for function arguments, etc.
Implementations§
Source§impl Env
impl Env
Sourcepub fn extend(parent: Rc<RefCell<Env>>) -> Self
pub fn extend(parent: Rc<RefCell<Env>>) -> Self
Create a new environment extending the given environment
Sourcepub fn get(&self, key: &Symbol) -> Option<Value>
pub fn get(&self, key: &Symbol) -> Option<Value>
Walks up the environment hierarchy until it finds the symbol’s value or runs out of environments.
Sourcepub fn define(&mut self, key: Symbol, value: Value)
pub fn define(&mut self, key: Symbol, value: Value)
Define a new key in the current environment
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Env
impl !RefUnwindSafe for Env
impl !Send for Env
impl !Sync for Env
impl Unpin for Env
impl !UnwindSafe for Env
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more