reorganized a bit, separated bind-symbol into two operators that have different uses, def and set

This commit is contained in:
2025-10-30 21:01:40 +03:00
parent ccf1aec5da
commit 45828a8dd4
3 changed files with 31 additions and 28 deletions

View File

@@ -27,7 +27,15 @@ and environment = (string, lisp_val) Hashtbl.t list
let env_set_local env s v =
match env with
| [] -> ()
| e1 :: _ -> Hashtbl.replace e1 s v
| e1 :: _ -> Hashtbl.replace e1 s v
let rec env_update env s v =
match env with
| [] -> ()
| e1 :: erest ->
match Hashtbl.find_opt e1 s with
| None -> env_update erest s v
| Some _ -> Hashtbl.replace e1 s v
let env_new_lexical env =
let h = Hashtbl.create 16 in