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 AAA00335; Mon, 18 Nov 2002 00:49:42 +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 AAA00329 for ; Mon, 18 Nov 2002 00:49:42 +0100 (MET) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAHNndX12247 for ; Mon, 18 Nov 2002 00:49:40 +0100 (MET) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id IAA00851; Mon, 18 Nov 2002 08:49:30 +0900 To: johan.baltie@wanadoo.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Abstract type over modules In-Reply-To: <200211171202.07170.johan.baltie@wanadoo.fr> References: <200211171202.07170.johan.baltie@wanadoo.fr> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-Id: <20021118084855G.garrigue@kurims.kyoto-u.ac.jp> Date: Mon, 18 Nov 2002 08:48:55 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Johan Balti=E9 > I'm having a strange problem with an abstract type used in 2 modules. > = > The problem can be summarized as: > = > ************************* test1.mli ************************* = > type toto > = > val test : toto -> toto > = > ************************* test2.mli ************************* = > open Test1 > = > val test2 : toto -> toto > = > ************************* test1.ml ************************* = > = > type toto =3D int > = > let test a =3D (Test2.test2 a) = OCaml does not allow mutual recursion between modules. This prohibition is not strictly enforced (you can actually compile test2.mli before test1.ml), but the problem appears when you try to use the recursion. Here the trouble is that, inside Test1, toto and Test1.toto are not the same type: we still don't know that we are defining Test1, so Test1.toto is just another type from another module named Test1. Merging the two modules is probably the simplest workaround. ------------------------------------------------------------------------= --- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac= .jp JG ------------------- 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