Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] any way to "clear" the toplevel?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-25 (23:54)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] any way to "clear" the toplevel?

I fixed this in my own toplevel by adding an #init.  Here's the code:

(* To init the toplevel env *)
let _ = Hashtbl.add directive_table "init" (Directive_none
                                              (fun () -> Env.reset_cache ();
                                                toplevel_env := Compile.initial_env()))

Just add that somewhere in toplevel/ and #init;; will clear out the environment.  It turns out the Env module's hash cache of the .cmi CRCs is what was preventing a reload of my file.  Not sure if that's a bug or not.


To unsubscribe, mail  Archives: