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 AAA03821; Wed, 20 Mar 2002 00:27:44 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA03544 for ; Wed, 20 Mar 2002 00:27:43 +0100 (MET) Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g2JNRgr27601 for ; Wed, 20 Mar 2002 00:27:42 +0100 (MET) Received: from user-0ccegg9.cable.mindspring.com ([24.199.66.9] helo=flapdragon.homeip.net) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16nT10-0002tu-00; Tue, 19 Mar 2002 15:27:38 -0800 Subject: Re: [Caml-list] Functorizing large collections of modules From: "Yaron M. Minsky" To: Sami =?ISO-8859-1?Q?M=E4kel=E4?= Cc: caml-list@inria.fr In-Reply-To: <3C95E312.28961EEF@utu.fi> References: <1016424584.26193.42.camel@dragonfly.localdomain> <87vgbu2qsd.dlv@wanadoo.fr> <1016453982.27588.53.camel@dragonfly.localdomain> <3C95E312.28961EEF@utu.fi> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution/1.0.2 Date: 19 Mar 2002 18:27:36 -0500 Message-Id: <1016580458.10273.46.camel@dragonfly.localdomain> Mime-Version: 1.0 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The solution suggested below clearly works, but it's just as clearly a bit of a hack. My feeling is that this is a bit of a fundamental weakness of ocaml and the module/functor system. OCaml is generally too module-centric, in that structuring tools are available only up to the level of modules, and there is no good structure beyond that. Another example of this weakness is the lack of support for namespaces.=20 Again, you can hack namespaces into existence by tossing lots of modules in the same file, but that's clearly a bad solution. Do any of the other MLs fare better in this department? And do people have good solutions for the namespace problem or the large-scale functor problem I outlined earlier? y On Mon, 2002-03-18 at 07:52, Sami M=E4kel=E4 wrote: > "Yaron M. Minsky" wrote: > > > > Conceptually what I want is a single structure like this: > > > > > > > > module Library(ZZp:ZZpSig) =3D > > > > struct > > > > > > > > module Foo =3D > > > > struct ... end > > > > > > > > module Bar =3D > > > > struct ... end > > > > > > > > ... > > > > > > > > end >=20 > what i have used is: >=20 > foo.ml: >=20 > module Library (ZZp:ZZpSig) =3D > struct > module Foo =3D struct ... end > end >=20 > bar.ml: >=20 > module Library (ZZp:ZZpSig) =3D > struct > include Foo.Library (ZZp) > module Bar =3D struct ... end > end >=20 > quux.ml: >=20 > module Library (ZZp:ZZpSig) =3D > struct > include Bar.Library (ZZp) > module Quux =3D struct ... end > end >=20 > etc. >=20 > there are still few problems, but perhaps this is good enough >=20 >=20 > > > > > > > > That way, all the interior modules (Foo, Bar) get to reference the = same > > > > ZZp, without having to functorize the individual modules. So, what= I'd > > > > like is to be able to do this without sticking the modules Foo and = Bar > > > > into the same single large unmanageable file. > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inr= ia.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 >=20 --=20 |--------/ Yaron M. Minsky \--------| |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| Open PGP --- KeyID B1FFD916 (new key as of Dec 4th) Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916 ------------------- 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