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 TAA17790 for caml-red; Thu, 29 Jun 2000 19:01:22 +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 SAA01847 for ; Thu, 29 Jun 2000 18:57:57 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e5TGvs118565; Thu, 29 Jun 2000 18:57:54 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA11050; Thu, 29 Jun 2000 18:57:53 +0200 (MET DST) From: Pierre Weis Message-Id: <200006291657.SAA11050@pauillac.inria.fr> Subject: Re: convenient features In-Reply-To: <20000628192916.B18617@miss.wu-wien.ac.at> from Markus Mottl at "Jun 28, 100 07:29:16 pm" To: mottl@miss.wu-wien.ac.at (Markus Mottl) Date: Thu, 29 Jun 2000 18:57:53 +0200 (MET DST) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr > On Wed, 28 Jun 2000, David Chemouil wrote: > > 1. One thing that really bothers me is the obligation to put object > > files in the good order, when linking them. > > To my knowledge the reason for this is that you might otherwise have > difficulties with linking, because some library may contain a module > with the same name. By requiring correct order of files during linking, > it is possible to "override" the names provided in libraries or earlier > on the command line. E.g., if you want to use a different implementation > for sets, just link against some other set.cmo: it overrides whatever > was used before. You're right, but also don't forget that toplevel expressions in modules are executed in the order of presentation (and recursively, that is in each module, for all the modules that are linked together). This way, if init.ml contains the expression initialize ();; and main.ml contains exit 0;; as its last phrase, then linking init.cmx before main.cmx ensures that initialization is performed before exiting the program. Best regards, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/