pub fn eval(
code: &str,
ctx: &Context
) -> Result<LinkedList<Result<String, String>>, LispErr>
Expand description
evaluate an expression
Example
let code = "(export factorial (n) (Pure (-> (Int) Int))
(if (<= n 0)
1
(* n (factorial (- n 1)))))";
let exprs = blisp::init(code, vec![]).unwrap();
let ctx = blisp::typing(exprs).unwrap();
let expr = "(factorial 30)";
for result in blisp::eval(expr, &ctx).unwrap() {
println!("{}", result.unwrap());
}