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 KAA10313; Wed, 20 Mar 2002 10:09:26 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA11436 for ; Wed, 20 Mar 2002 10:09:25 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g2K99P920131 for ; Wed, 20 Mar 2002 10:09:25 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA11924 for caml-list@inria.fr; Wed, 20 Mar 2002 10:09:24 +0100 (MET) Date: Wed, 20 Mar 2002 10:09:24 +0100 From: Francois Pottier To: caml-list@inria.fr Subject: Re: [Caml-list] Functorizing large collections of modules Message-ID: <20020320100924.A11574@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <1016424584.26193.42.camel@dragonfly.localdomain> <87vgbu2qsd.dlv@wanadoo.fr> <1016453982.27588.53.camel@dragonfly.localdomain> <3C95E312.28961EEF@utu.fi> <1016580458.10273.46.camel@dragonfly.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <1016580458.10273.46.camel@dragonfly.localdomain>; from yminsky@cs.cornell.edu on Tue, Mar 19, 2002 at 06:27:36PM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Yaron M. Minsky writes: > The solution suggested below clearly works, but it's just as clearly a > bit of a hack. You want Foo and Bar to exist within separate files, even though they are both parameterized by the same module ZZp. This is, I believe, a frequent problem for people trying to program in a modular way. It seems that, if you insist that Foo and Bar should be separately compilable, then you must describe their interface to the compiler, which means you must turn each of them into a functor, parameterized over ZZp. This leads you to the solution that was posted, which, I believe, is manageable to a certain degree. Now, if on the other hand, you don't really care about separate compilation of Foo and Bar, then you can place them in separate files, and have your Makefile automatically catenate them for compilation. Given the speed of today's machines, this solution should be acceptable in many cases. I don't know of a third solution, but of course, I'd love to stand corrected. > Another example of this weakness is the lack of support for namespaces. It is true that O'Caml has little support for resolving name conflicts in a modular way, because the semantics of the module language is too intimately tied with the underlying file system. I suppose a CM-like tool would help, but I think this issue is separate from the one above. -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners