From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 45FDEBBAF for ; Wed, 20 Aug 2008 16:59:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwAABXOq0hCbwQbmmdsb2JhbACSFwEBAQEBCAUIBxEEowOBWQ X-IronPort-AV: E=Sophos;i="4.32,240,1217800800"; d="scan'208";a="16300205" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 20 Aug 2008 16:59:19 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m7KExHaF027969 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 20 Aug 2008 16:59:19 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwAABXOq0hCbwQbmmdsb2JhbACSFwEBAQEBCAUIBxEEowOBWQ X-IronPort-AV: E=Sophos;i="4.32,240,1217800800"; d="scan'208";a="16300204" Received: from out3.smtp.messagingengine.com ([66.111.4.27]) by mail1-smtp-roc.national.inria.fr with ESMTP; 20 Aug 2008 16:59:18 +0200 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id F04CE15AF9A; Wed, 20 Aug 2008 10:59:15 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 20 Aug 2008 10:59:16 -0400 X-Sasl-enc: OzsnyV1hYNKfKo4aWb6MD5dmVlB1vM4nw3qOAGO/8qQ2 1219244355 Received: from [192.168.1.10] (ALyon-157-1-41-125.w83-201.abo.wanadoo.fr [83.201.72.125]) by mail.messagingengine.com (Postfix) with ESMTPSA id 1A2D87BEC; Wed, 20 Aug 2008 10:59:14 -0400 (EDT) Date: Wed, 20 Aug 2008 16:53:36 +0200 (CEST) From: Martin Jambon X-X-Sender: martin@martin.ec.wink.com To: =?ISO-8859-1?Q?J=E9r=E9mie_Lumbroso?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Specifying recursive modules? In-Reply-To: <2b7b425b0808200731x6dd6aa12udd03c16dbb8eae05@mail.gmail.com> Message-ID: References: <2b7b425b0808200731x6dd6aa12udd03c16dbb8eae05@mail.gmail.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-536063432-1219244007=:23985" Content-ID: X-Miltered: at concorde with ID 48AC3145.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 recursive:01 unreadable:01 mime-aware:01 ocaml:01 ocaml's:01 recursive:01 toplevel:01 toplevel:01 sig:01 syntax:01 mli:01 sig:01 ocaml:01 mli:01 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-536063432-1219244007=:23985 Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1; FORMAT=flowed Content-Transfer-Encoding: 8BIT Content-ID: On Wed, 20 Aug 2008, Jérémie Lumbroso wrote: > Hello, > > I'd always thought of separating specification and definition as > simply not possible in OCaml, but OCaml's reference manual (3.10, > which is, as far as I can tell, the most recent version of the > documentation) seems to contradict my assumption: > > http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#htoc100 > > It says that recursive specifications can be written as: > > > module rec : { and ... } > > > What does this mean? When I attempt to use this feature in the > toplevel, it results in an error: > > > # module rec Tmp : sig > type t = Stop | Next of Tmp.t > end**;;** > Syntax error > This is a signature item, i.e. goes directly in a .mli file or in the definition of a module signature: module type X = sig module rec A : sig type t = A of B.t end and B : sig type t = B of A.t end end Martin > On the off-chance that OCaml might explicitly need an "and", I also > tried adding a second dummy module to the definition, but no dice ... > When I try to use this feature in a .mli/.ml file coupling, I get the > same (syntax) error. Have I misunderstood the usage? Or has this been > removed since its introduction (and the documentation not updated > accordingly)? Or is this a bug? > > Jérémie > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- http://mjambon.com/ --8323328-536063432-1219244007=:23985--