cl_interpret/
lib.rs

1//! Walks a Conlang AST, interpreting it as a program.
2#![warn(clippy::all)]
3#![feature(decl_macro)]
4
5use cl_ast::Sym;
6use convalue::ConValue;
7use env::Environment;
8use error::{Error, ErrorKind, IResult};
9use interpret::Interpret;
10
11/// 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
15    fn call(&self, interpreter: &mut Environment, args: &[ConValue]) -> IResult<ConValue>;
16    /// Returns the common name of this identifier.
17    fn name(&self) -> Sym;
18}
19
20pub mod convalue;
21
22pub mod interpret;
23
24pub mod function;
25
26pub mod closure;
27
28pub mod builtin;
29
30pub mod pattern;
31
32pub mod env;
33
34pub mod error;
35
36#[cfg(test)]
37mod tests;