From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA10085 for caml-red; Thu, 2 Nov 2000 18:41:00 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA10780 for ; Tue, 31 Oct 2000 20:11:46 +0100 (MET) Received: from math.berkeley.edu (gold.Math.Berkeley.EDU [169.229.58.61]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id e9VJBj101416 for ; Tue, 31 Oct 2000 20:11:45 +0100 (MET) Received: from yuban-c.math.berkeley.edu (blue1.Math.Berkeley.EDU [169.229.58.58]) by math.berkeley.edu (8.9.3/8.9.3) with ESMTP id LAA04727; Tue, 31 Oct 2000 11:11:44 -0800 (PST) Received: (from datta@localhost) by yuban-c.math.berkeley.edu (8.9.3/8.9.3) id LAA04381; Tue, 31 Oct 2000 11:11:25 -0800 (PST) Date: Tue, 31 Oct 2000 11:11:24 -0800 From: Ruchira Datta To: caml-list@inria.fr Subject: Re: Redefinition doesn't work Message-ID: <20001031111124.A3926@blue1.berkeley.edu> Reply-To: datta@math.berkeley.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: weis@pauillac.inria.fr Pierre Weis wrote: >Mattias Waldau wrote: >> One of the reason of me liking OCaml is the interactive top level. However, >> it is a bit messy always remember to redefine all functions that depend of >> the function you just corrected. > >You just have to use a very simple rule: reload your source file after >each correction (use #use "filename.ml";;). Well, part of the point of the interactive top level is that you can try out commands at the prompt, rather than having to put them in a separate file. However, you can have the best of both worlds with ledit (see http://cristal.inria.fr/~ddr). Just keep a running history of your interactive session by starting it up as follows: ledit -h "./ocaml_history" -x ocaml Then to reload the functions that depend on the function you just corrected, you have two options (which is more convenient depends on how many redefinitions have to be made): - if there are only a few redefinitions: just use the up arrow to go back to the original definitions and reenter them - if there are many redefinitions: go into a text editor in a separate window, paste their definitions from the file ocaml_history into some other file, e.g., temp.ml, and finally go back to your ocaml interactive session and load the file with #use "temp.ml" as above. Ruchira Datta datta@math.berkeley.edu