(* Time-stamp: <modified the 14/06/2019 (at 13:21) by Erwan Jahier> *) module Dico = Map.Make(String) open Algo type t = local_env Dico.t let (get: t -> string -> Algo.local_env) = fun e pid -> (* Printf.printf "<-- get pid %s\n" pid; flush stdout; *) try ((Dico.find pid e)) with e -> failwith (Printf.sprintf "Unknown pid: %s (%s)" pid (Printexc.to_string e)) let (get_copy: Algo.vars -> t -> string -> Algo.local_env) = fun vars e pid -> Algo.copy_local_env vars (get e pid) let (set: t -> string -> Algo.local_env -> t) = fun e pid lenv -> (* Printf.printf "--> set pid %s\n" pid; flush stdout; *) let lenv = Algo.set lenv "pid" (Algo.S pid) in Dico.add pid lenv e let (init:unit -> t) = fun () -> Dico.empty