Trait LispCallable

Source
pub trait LispCallable: Debug + DynClone {
    // Required methods
    fn arity(&self) -> &FunctionArity;
    fn call(
        &self,
        args: Vec<Ast>,
        env: &mut Environment,
    ) -> Result<Ast, LispError>;
}
Expand description

Trait used to define Lisp functions.

Required Methods§

Source

fn arity(&self) -> &FunctionArity

Return the arity of the function.

Source

fn call(&self, args: Vec<Ast>, env: &mut Environment) -> Result<Ast, LispError>

Call the function and return the result.

Trait Implementations§

Source§

impl Clone for Box<dyn LispCallable>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§