From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA08906; Fri, 27 Apr 2001 09:14:43 +0200 (MET DST) 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 JAA09079 for ; Fri, 27 Apr 2001 09:14:43 +0200 (MET DST) Received: from mail.mimuw.edu.pl (pm129.warszawa.cvx.ppp.tpnet.pl [213.76.108.129]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3R7EF128812 for ; Fri, 27 Apr 2001 09:14:22 +0200 (MET DST) Received: (from news@localhost) by mail.mimuw.edu.pl (PLD/8.9.3) id GAA08917 for caml-list@inria.fr; Fri, 27 Apr 2001 06:03:36 +0200 X-Authentication-Warning: qrnik.zagroda: news set sender to qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) using -f From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Subject: Re: [Caml-list] any way to "clear" the toplevel? Date: 27 Apr 2001 04:03:33 GMT Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?= Message-ID: References: <4.3.2.7.2.20010425165253.00e05ba0@shell16.ba.best.com> <20010426100502B.garrigue@kurims.kyoto-u.ac.jp> <20010427095033Q.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Trace: qrnik.zagroda 988344213 8915 192.168.0.1 (27 Apr 2001 04:03:33 GMT) X-Complaints-To: news@qrnik.zagroda NNTP-Posting-Date: 27 Apr 2001 04:03:33 GMT User-Agent: slrn/0.9.6.3 (Linux) To: caml-list@inria.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Fri, 27 Apr 2001 09:50:33 +0900, Jacques Garrigue pisze: > My next point was pointing at a more concrete problem, that you may > have to solve even if signatures did not change: values in ADT's. > What is GHC doing about that? "Interface" is a compiler-generated file. It changes when some part relevant for compilation of other modules changes, e.g. the representation of an ADT or the body of an inlined function. The compiler cares to not overwrite this file if it's the same as the previous version, to avoid unnecessary recompilation of dependent modules. > But I'm not sure whether you can define values at toplevel, in the > way you do in ML. You can, but they are forgotten on reloading modules, even if nothing changed. Perhaps it would make sense to improve this behavior, but they should be flushed at some time, because in Haskell, as opposed to OCaml, later bindings don't normally cover previous bindings of the same name. They do cover when defined at the toplevel (the toplevel mimics the body of an imperative function rather than a set of module-level declarations). It's not obvious how to keep this covering policy on reloading modules which logically sit behind toplevel-defined names. It's not really that inconvenient to have these names flushed, because all changed modules can be reloaded by issuing one command, so the user can define values intended to last longer in a module rather than on the toplevel - the compiler remembers how the environment was created and recreates it as needed. You can't define types on the toplevel, so it's sometimes necessary anyway. GHC's interactive toplevel is new: the first version which includes it was released less than a month ago. Details are likely to change. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr