let rec add_def (env:environment) name def =
try
ignore (get_def env name);
raise Already_defined
with
| Not_found -> (name, def) :: env
(**
Get a the value associated to a name in an environment. Remark: don't forget that procedures and functions are binders and should therefore be added to the current environment.
@raise Not_found if no definition was made for that name. *) |
and get_def (env:environment) name =
List.assoc name env