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 SAA24114; Thu, 22 Mar 2001 18:13:25 +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 SAA23951 for ; Thu, 22 Mar 2001 18:13:24 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2MHDOb01662 for ; Thu, 22 Mar 2001 18:13:24 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id SAA06936 for caml-list@inria.fr; Thu, 22 Mar 2001 18:13:24 +0100 Date: Thu, 22 Mar 2001 18:13:24 +0100 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files Message-ID: <20010322181324.C4907@verdot.inria.fr> References: <20010322140157.A7070@miss.wu-wien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0us In-Reply-To: ; from bpr@best.com on Thu, Mar 22, 2001 at 08:56:25AM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi everybody, My usual hack for mutually recursive functions in different modules: File foo.ml: let g_ref = ref (fun _ -> failwith "Bar.g not yet defined") let g x = !g_ref x let f ... = .... g ... File bar.ml: let g .... = .... Foo.f ... Foo.g_ref := g By extending the language using Camlp4, by the constructions "forward" and "define_forward" doing the right thing, you could have: File foo.ml: forward g let f ... = .... g ... File bar.ml: let g .... = .... Foo.f ... define_forward g -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr