Preparing to implement multiple environments

Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
teo3300
2023-06-13 23:59:39 +02:00
parent d1c56b02bb
commit fe92bbcaa1
8 changed files with 138 additions and 74 deletions

View File

@ -4,8 +4,8 @@
// input, thus this can be referenced by the previous step without the need
// to allocate more memory
use crate::envs::Env;
use crate::mal_core::eval;
use crate::env::Env;
use crate::eval::eval;
use crate::printer::pr_str;
use crate::reader::read_str;
use crate::types::{MalRet, MalType};
@ -22,7 +22,7 @@ fn READ(input: &str) -> MalRet {
#[allow(non_snake_case)]
/// Evaluate the generated ast
fn EVAL(ast: MalType, env: &Env) -> MalRet {
match eval(ast, env) {
match eval(&ast, env) {
Ok(ast) => Ok(ast),
Err(err) => Err(format!("@ EVAL: {}", err)),
}