pub struct ModuleData { /* private fields */ }Expand description
A loaded module containing an immutable, name-sorted table of unevaluated
item bodies. Built by crate::compile_module and stored in an Rc.
Sibling references are compiled to Expr::ModItem and resolved via the
home module in the environment (crate::eval_env::EnvNode::Module), ensuring the value
heap remains acyclic. See docs/done/2026-08-07_elly-modules-v0.md.
Sibling references use a direct slice index; outside M.name accesses use binary search.
Implementations§
Source§impl ModuleData
impl ModuleData
Sourcepub fn item_names(&self) -> impl Iterator<Item = &Text>
pub fn item_names(&self) -> impl Iterator<Item = &Text>
Sorted list of public item names accessible via outside M.name access.
Sourcepub fn local_names(&self) -> Vec<&Text>
pub fn local_names(&self) -> Vec<&Text>
Sorted list of names declared with local. Locals are unreachable
via M.name from outside; this method is provided for host
introspection (e.g., debuggers).
Sourcepub fn iota_names(&self) -> &[Text]
pub fn iota_names(&self) -> &[Text]
Sorted list of names declared with const. Private iotas are unreachable
via M.name from outside.
Sourcepub fn frame_names(&self) -> &[Text]
pub fn frame_names(&self) -> &[Text]
Names of frame slots in order. Defines the requirements for
instantiate. Empty if no frame exists.
Sourcepub fn imports(&self) -> &[ImportSpec]
pub fn imports(&self) -> &[ImportSpec]
Import specifications in slot order. Provides a static, auditable record of reachable modules without requiring execution.
Sourcepub fn body(&self) -> Option<&Expr>
pub fn body(&self) -> Option<&Expr>
Returns the module’s body (a recur group’s body or a source’s __main).
Evaluated by runners in the instance environment (see crate::eval_main);
remains inert during imports.
Sourcepub fn name(&self) -> Option<&ModuleName>
pub fn name(&self) -> Option<&ModuleName>
The canonical name assigned by the host. Used by __Mod.name and the
const stage for instance deduplication. None if unnamed.
Trait Implementations§
Source§impl Debug for ModuleData
impl Debug for ModuleData
impl Eq for ModuleData
Source§impl PartialEq for ModuleData
impl PartialEq for ModuleData
Source§fn eq(&self, other: &ModuleData) -> bool
fn eq(&self, other: &ModuleData) -> bool
self and other values to be equal, and is used by ==.