1//! Walks a Conlang AST, interpreting it as a program.
2#![warn(clippy::all)]
3#![feature(decl_macro)]
45use cl_ast::Sym;
6use convalue::ConValue;
7use env::Environment;
8use error::{Error, ErrorKind, IResult};
9use interpret::Interpret;
1011/// Callable types can be called from within a Conlang program
12pub trait Callable: std::fmt::Debug {
13/// Calls this [Callable] in the provided [Environment], with [ConValue] args \
14 /// The Callable is responsible for checking the argument count and validating types
15fn call(&self, interpreter: &mut Environment, args: &[ConValue]) -> IResult<ConValue>;
16/// Returns the common name of this identifier.
17fn name(&self) -> Sym;
18}
1920pub mod convalue;
2122pub mod interpret;
2324pub mod function;
2526pub mod closure;
2728pub mod builtin;
2930pub mod pattern;
3132pub mod env;
3334pub mod error;
3536#[cfg(test)]
37mod tests;