Struct cl_interpret::env::Frame
source · pub struct Frame<'scope> { /* private fields */ }
Expand description
Represents a stack frame
Methods from Deref<Target = Environment>§
pub fn eval(&mut self, node: &impl Interpret) -> IResult<ConValue>
sourcepub fn call(&mut self, name: Sym, args: &[ConValue]) -> IResult<ConValue>
pub fn call(&mut self, name: Sym, args: &[ConValue]) -> IResult<ConValue>
Calls a function inside the interpreter’s scope, and returns the result
sourcepub fn frame(&mut self, name: &'static str) -> Frame<'_>
pub fn frame(&mut self, name: &'static str) -> Frame<'_>
Enters a nested scope, returning a Frame
stack-guard.
Frame
implements Deref/DerefMut for Environment
.
sourcepub fn get_mut(&mut self, id: Sym) -> IResult<&mut Option<ConValue>>
pub fn get_mut(&mut self, id: Sym) -> IResult<&mut Option<ConValue>>
Resolves a variable mutably.
Returns a mutable reference to the variable’s record, if it exists.
sourcepub fn get(&self, id: Sym) -> IResult<ConValue>
pub fn get(&self, id: Sym) -> IResult<ConValue>
Resolves a variable immutably.
Returns a reference to the variable’s contents, if it is defined and initialized.
Trait Implementations§
Auto Trait Implementations§
impl<'scope> Freeze for Frame<'scope>
impl<'scope> !RefUnwindSafe for Frame<'scope>
impl<'scope> !Send for Frame<'scope>
impl<'scope> !Sync for Frame<'scope>
impl<'scope> Unpin for Frame<'scope>
impl<'scope> !UnwindSafe for Frame<'scope>
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