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 KAA12745; Thu, 22 Mar 2001 10:11:29 +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 KAA12545 for ; Thu, 22 Mar 2001 10:11:28 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2M9BQb12732; Thu, 22 Mar 2001 10:11:26 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA12770; Thu, 22 Mar 2001 10:11:25 +0100 (MET) Date: Thu, 22 Mar 2001 10:11:25 +0100 From: Francois Pottier To: Patrick M Doane Cc: caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files Message-ID: <20010322101125.A12544@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <3AB8F0F8.69FF32B1@ozemail.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: ; from patrick@watson.org on Wed, Mar 21, 2001 at 07:03:55PM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Mar 21, 2001 at 07:03:55PM -0500, Patrick M Doane wrote: > > I'm back to the source of the problem, having to duplicate a large variant > type. I think you have missed the point of John's (or was it Brian's?) suggestion, which is to place large type (or module type) definitions in a separate .mli (or .ml) file, then refer to it from your .mli *and* your .ml file. This has the unfortunate consequence of breaking every module into three files (shared definitions, interface, and implementations), making the program structure somewhat more cryptic. But it usually works well. Regarding your suggestion, > For every module definition M that has a signature S > For every type definition t in S that contains optional > type-information and is not defined in M > Add the type definition of t to M (preserving the order from S) ^^^^^^^^^^^^^^^^^^^^ I think the problematic part is in the ordering. The order in which bindings appear may be different in M and S, to start with. So, where do we insert the definition, and (assuming we know where) what do we do if some names referred to by the definition aren't yet defined in M at that point? -- 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