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 GAA21474; Wed, 28 Mar 2001 06:30:24 +0200 (MET DST) 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 GAA21470 for ; Wed, 28 Mar 2001 06:30:23 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2S4ULT24829 for ; Wed, 28 Mar 2001 06:30:21 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id UAA10137; Tue, 27 Mar 2001 20:30:17 -0800 (PST) Date: Tue, 27 Mar 2001 20:30:17 -0800 (PST) From: Brian Rogoff To: John Max Skaller cc: caml-list@inria.fr Subject: Re: [Caml-list] recursive modules redux, & interface files In-Reply-To: <3AC11021.D0D6BF4A@ozemail.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 28 Mar 2001, John Max Skaller wrote: > Brian Rogoff wrote: > > I agree with this general principle, and to be honest, I haven't found in > > my own programming a compelling case where module spanning mutually > > recursive function definitions were an issue. Is it possible to produce a > > reasonably sized example, Hendrik (or Chris)? > > I have such an example. In the Vyper interpreter, there is a > very large module which handles execution of ASTs, which contains > almost all the interpretive code. It was not possible to break this > module into further pieces because of the mutual recursion. This seems simialr to Fergus Henderson's example in the Mercury compiler. I thought his rationale was convincing (the file just got too big) and I assume he and you considered various refactorings to keep from splitting the module and decided against them. So even though there's practically no better example of functions that belong in the same module as mutually recursive ones, pragmatics suggests that you split them. None of the compiler like programs I've worked on have become that big yet. > [I actually _did_ do this, then undid it, because of the excessive > number of extra arguments that had to be passed to make it work] Yes, that can be a problem with the trick/hack of passing extra arguments. Did you consider the trick Daniel showed using function references which get initialized in the right order during the calls? I don't like introducing references unnecessarily but it might be useful until there is a cleaner solution. -- Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr