Trait cl_interpret::Callable

source ·
pub trait Callable: Debug {
    // Required methods
    fn call(
        &self,
        interpreter: &mut Environment,
        args: &[ConValue]
    ) -> IResult<ConValue>;
    fn name(&self) -> Sym;
}
Expand description

Callable types can be called from within a Conlang program

Required Methods§

source

fn call( &self, interpreter: &mut Environment, args: &[ConValue] ) -> IResult<ConValue>

Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types

source

fn name(&self) -> Sym

Returns the common name of this identifier.

Implementors§