English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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/topdirs.ml 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 caml-list-request@inria.fr.  Archives: http://caml.inria.fr