added closures

This commit is contained in:
Moritz Gmeiner 2024-08-28 23:58:55 +02:00
commit b425a59db5
5 changed files with 59 additions and 28 deletions

View file

@ -6,8 +6,7 @@ module Hashtbl = struct
let contains tbl key = find_opt tbl key |> Option.is_some
end
type env_table = (string, lox_value) Hashtbl.t
type environment = { globals : env_table ref; locals : env_table list }
type environment = Value.environment
module Env = struct
type t = environment