pub trait FuncImpl: HasFuncSignature {
// Required method
fn evaluate(
&self,
state: &mut InterpreterState<'_>,
args: Vec<TermReference>,
) -> (TermReference, NewlyEvaluatedTerms);
}Expand description
Trait for primitive function implementations.
Required Methods§
Sourcefn evaluate(
&self,
state: &mut InterpreterState<'_>,
args: Vec<TermReference>,
) -> (TermReference, NewlyEvaluatedTerms)
fn evaluate( &self, state: &mut InterpreterState<'_>, args: Vec<TermReference>, ) -> (TermReference, NewlyEvaluatedTerms)
Given a handle on the current InterpreterState (primarily useful if additional terms
need to be evaluated / looked up) and the collection of TermReference arguments to
apply this function implementation to, yields a TermReference to the result, along
with a collection of any NewlyEvaluatedTerms which may have arisen as part of the
implementation of this method. See func_impl.rs in the source for sample implementations.