pub struct BaseEnv { /* private fields */ }Expand description
The compile-time environment: the flat name -> value table of
primitives and base constants that crate::compile folds unshadowed
references against, and whose BaseEnv::names seed the elaborator’s
scope.
This is deliberately NOT the runtime environment, and is not the root of
the runtime frame chain. Nothing resolves a name at run time —
top-level bindings go through the compiler’s Globals table, locals
through slot indices, and unshadowed base names are constant-folded at
compile time — so the two are what they actually are: a name map used
while compiling, and a stack of positional frames used while running.
Implementations§
Source§impl BaseEnv
impl BaseEnv
pub fn new() -> BaseEnv
Sourcepub fn child(&self) -> BaseEnv
pub fn child(&self) -> BaseEnv
A copy that can be extended without disturbing this one. There is no frame chain here — shadowing is just overwriting in the copy.
pub fn define(&mut self, name: impl Into<Rc<str>>, value: Value)
pub fn lookup(&self, name: &str) -> Option<Value>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BaseEnv
impl !Send for BaseEnv
impl !Sync for BaseEnv
impl !UnwindSafe for BaseEnv
impl Freeze for BaseEnv
impl Unpin for BaseEnv
impl UnsafeUnpin for BaseEnv
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more