pub struct Library { /* private fields */ }Expand description
The functions a formula may call, by upper-case name: the seam. Every
function registered is a function of its arguments and of the cell it is
computed at, and of nothing else: no clock, no chance, no state of its
own. An engine’s machine computes a cell again only when a cell it reads
has changed (KERNEL.20, super::reach), so a function that answered
differently over the same arguments would be computed once and kept.
Implementations§
Source§impl Library
impl Library
Sourcepub fn register(
&mut self,
name: &str,
f: fn(&Ctx<'_>, &[Arg<'_>]) -> Result<Value, Reason>,
)
pub fn register( &mut self, name: &str, f: fn(&Ctx<'_>, &[Arg<'_>]) -> Result<Value, Reason>, )
Register a strict function; a later registration of the same name replaces the earlier.
Sourcepub fn register_form(
&mut self,
name: &str,
f: for<'e> fn(&Ctx<'_>, &'e [Expr]) -> Result<Arg<'e>, Reason>,
)
pub fn register_form( &mut self, name: &str, f: for<'e> fn(&Ctx<'_>, &'e [Expr]) -> Result<Arg<'e>, Reason>, )
Register a form.
Sourcepub fn strict(
&self,
name: &str,
) -> Option<fn(&Ctx<'_>, &[Arg<'_>]) -> Result<Value, Reason>>
pub fn strict( &self, name: &str, ) -> Option<fn(&Ctx<'_>, &[Arg<'_>]) -> Result<Value, Reason>>
The strict function of that name, without case.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnsafeUnpin for Library
impl UnwindSafe for Library
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