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§
sourcefn call(
&self,
interpreter: &mut Environment,
args: &[ConValue]
) -> IResult<ConValue>
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