glisp/environment

// A module for managing environments that map variable names to expressions.

Types

Environments are used during evaluation to keep track of variable bindings and their corresponding values.

pub type Env =
  dict.Dict(String, Expr)

Values

pub fn get(
  env: Dict(String, Expr),
  key: String,
) -> Result(Expr, String)

Get a value from the environment

pub fn new() -> Dict(String, Expr)

Create a new empty environment

pub fn set(
  env: Dict(String, Expr),
  key: String,
  value: Expr,
) -> Dict(String, Expr)

Set a value in the environment

Search Document