From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2HDiW8v026005; Thu, 17 Mar 2011 14:44:32 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0CAP+sgU3RVdg2kGdsb2JhbACeZAGGGkcIFAEBAQEJCQ0HFAQhqRyKPoIehSkviFsBAQMFhV4EjF6IeTo X-IronPort-AV: E=Sophos;i="4.63,199,1299452400"; d="scan'208";a="94325434" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Mar 2011 14:44:27 +0100 Received: by qwc9 with SMTP id 9so3036785qwc.27 for ; Thu, 17 Mar 2011 06:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=fB1wJmiZRORjsonhW16Xz7zT5rbgpajDqJoubFJAvTU=; b=PZvAX2nXrHjEHRozAm3++Yy+iWozEPw+C1at1wZotf//dzrF2U/XMjd2ce5e8NSXDg RW4y16iepqFcYchxdOPO2RDuBurGMQ3YyJuBEg3AjH7JQgScmGHCyBfQ7EVS1LjcvslG o8TRy5DzpUDeTXbKfNRATg3BdPw0A6sTOlMBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=TSzneNm3od04xx4Oig9sBCJN22fmk4xhxPOu3kGgFjRi6R4oCufjRkyo890rslaj5O i5W/Em6inweWpWKsCtA63e5yNuCkX/qQmAA217ci4N4a/AFLZW0gH3MWrILOwlm0hfqA 7ExzWNbpiCy9ESvdr8tLR4JCoe7vg/m7COJL4= Received: by 10.229.41.133 with SMTP id o5mr1033789qce.160.1300369464145; Thu, 17 Mar 2011 06:44:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.226.196 with HTTP; Thu, 17 Mar 2011 06:44:04 -0700 (PDT) In-Reply-To: <20110317110552.GP22969@localhost> References: <20110317104719.GH22969@localhost> <20110317110552.GP22969@localhost> From: Gabriel Scherer Date: Thu, 17 Mar 2011 14:44:04 +0100 Message-ID: To: Guillaume Yziquel Cc: Pierre-Alexandre Voye , caml-list , caml-webmaster@inria.fr Content-Type: multipart/alternative; boundary=001636833dacfcbc45049eaddb11 Subject: Re: [Caml-list] Re: Define class and sum type in one time --001636833dacfcbc45049eaddb11 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Mar 17, 2011 at 12:05 PM, Guillaume Yziquel < guillaume.yziquel@citycable.ch> wrote: > No, you can. Break the recursivity with a recursive module. However, > it's quite clumsy, so if you do not have a compelling reason to use > object, avoid the useless complexity. > I have seen similar questions (how to define mutually recursive type/exception/classes...) asked many times. It is quite natural and the answer is not so obvious. Maybe it would be a good candidate for adoption in the OCaml FAQ? http://caml.inria.fr/resources/doc/faq/index.en.html PS : I remember reading about an extension to OCaml where all compilation units where implicitly recursive, so that you could write Current_module.foo and have mutual structure item recursion for free. I thought it was from Alain Frisch, but a search on Lexifi's blog didn't return anything. Has one list reader kept the reference to this article? --001636833dacfcbc45049eaddb11 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Thu, Mar 17, 2011 at 12:05 PM, Guillaume Yziq= uel <guillaume.yziquel@citycable.ch> wrote:
No, you can. Break the recursivity with a recursive module. However,
it's quite clumsy, so if you do not have a compelling reason to use
object, avoid the useless complexity.

I have seen = similar questions (how to define mutually recursive type/exception/classes.= ..) asked many times. It is quite natural and the answer is not so obvious.= Maybe it would be a good candidate for adoption in the OCaml FAQ?
=A0 http:/= /caml.inria.fr/resources/doc/faq/index.en.html

PS : I remember r= eading about an extension to OCaml where all compilation units where implic= itly recursive, so that you could write Current_module.foo and have mutual = structure item recursion for free. I thought it was from Alain Frisch, but = a search on Lexifi's blog didn't return anything. Has one list read= er kept the reference to this article?
--001636833dacfcbc45049eaddb11--