color E = with e; globref to_prc = IO.std_out; globref from_prc = std_in; (* change path to fit your filesystem *) fun start_process () = let val (x,y) = execute_in_env("/sub_process.tcl",[], ["DISPLAY=:0.0"]); in to_prc := y; from_prc := x end; fun send (n:int) = (IO.output(!to_prc,(makestring n)^"\n"); IO.flush_out (!to_prc)); exception Comm_Err; fun check_response () = case input (!from_prc,2) of "1\n" => () | _ => raise Comm_Err;