locrian 0.2.2

A simple embeddable functional programming language.
Documentation
use crate::eval::EvalFn;

pub(crate) static use_: EvalFn = func!(
    r#"
    let({
        "$use": array:merge($0, $use)
    }, $1)
    "#
);

#[cfg(test)]
mod tests {
    use crate::{eval::EvalResult, eval_str, stdlib::STDLIB};

    #[test]
    pub fn test_use() {
        assert_eq!(
            eval_str(
                r#"use(["string", "num"], 'concat("hello", " ", "world", add(2, 1)))"#,
                STDLIB.clone()
            )
            .unwrap(),
            EvalResult::String("hello world3".to_string())
        );
    }
}