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 OAA13043; Thu, 26 Jun 2003 14:14:19 +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 OAA10820 for ; Thu, 26 Jun 2003 14:14:18 +0200 (MET DST) 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 h5QCEGj10500; Thu, 26 Jun 2003 14:14:16 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA12239; Thu, 26 Jun 2003 14:14:16 +0200 (MET DST) Date: Thu, 26 Jun 2003 14:14:15 +0200 From: Xavier Leroy To: brogoff@speakeasy.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] Recursive modules and polymorphic recursion Message-ID: <20030626141415.B11992@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from brogoff@speakeasy.net on Wed, Jun 25, 2003 at 09:58:50PM -0700 X-Spam: no; 0.00; caml-list:01 recursion:01 chagrin:01 okasaki:01 barf:01 publi:01 recursions:01 run-time:01 3.07:01 permanent:98 rec:01 polymorphic:01 modules:02 module:03 recursive:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I was playing with the recursive modules in the CVS snapshot and > much to my chagrin the very first pr function of the very first pr > example in Okasaki causes the system to barf, where barf means > "Cannot safely evaluate the definition of the recursively-defined > module RAListImpl". Is this a temporary limitation of the CVS > version or a permanent limitation of the feature? I've appended the > code to this email. As the design document explains (http://pauillac.inria.fr/~xleroy/publi/recursive-modules-note.pdf), the current implementation of recursive modules is such that a definition module rec A : SIGA = StructA is accepted only if all value components of SIGA are functions. This isn't the case in your example because of the "empty" value component. This restriction comes from the way ill-founded recursions are detected at run-time. Yes, it's an unfortunate restriction, and eventually it will go away once I figure out a suitable static analysis for well-foundedness of recursive definitions. But this may take a while. The decision to integrate recursive modules in 3.07 was taken on the grounds that imperfect recursive modules are still better than no recursive modules at all. Be patient: perfection takes time. - Xavier Leroy ------------------- 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