glisp/eval

Values

pub fn eval(
  expr: Expr,
  env: Dict(String, Expr),
) -> Result(Expr, String)

Evaluate an expression in the given environment

This function is the core of the interpreter, handling different expression types:

  • Numbers evaluate to themselves
  • Atoms are looked up in the environment
  • Built-in functions return themselves
  • Lists handle special forms (define, if) or function application
Search Document