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 SAA30505 for caml-red; Sat, 28 Oct 2000 18:37:24 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA26834 for ; Sat, 28 Oct 2000 09:34:10 +0200 (MET DST) Received: from tor.abc.se (ns.abc.se [195.17.72.11]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id e9S7Y9T09495 for ; Sat, 28 Oct 2000 09:34:10 +0200 (MET DST) Received: from gateway (dialup-76 [195.17.73.76]) by tor.abc.se (8.9.3+Sun/8.9.1) with SMTP id JAA12599 for ; Sat, 28 Oct 2000 09:34:08 +0200 (MET DST) From: "Mattias Waldau" To: "Caml-List" Subject: Redefinition doesn't work Date: Sat, 28 Oct 2000 09:32:31 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: weis@pauillac.inria.fr 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. For example below, f2 doesn't notice the redefinition of f1, even if the types of the new and old definition of f1 are the same. The last language I used that had this feature was Forth, and that was 20 years ago, we used 8Kb of memory and a 6502. These 8 Kb contained both the interactive compiler, the program, and the data. What is the reason for this misfeature? # let f1 () = 10;; val f1 : unit -> int = # let f2 () = (f1 ()) * 10;; val f2 : unit -> int = # f2 ();; - : int = 100 # let f1 () = 20;; val f1 : unit -> int = # f2 ();; - : int = 100 # ---- Mattias Waldau