From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
Cc: Pierre-Alexandre Voye <ontologiae@gmail.com>,
caml-list <caml-list@inria.fr>,
caml-webmaster@inria.fr
Subject: Re: [Caml-list] Re: Define class and sum type in one time
Date: Thu, 17 Mar 2011 14:44:04 +0100 [thread overview]
Message-ID: <AANLkTimCo-CDsj_tpa9hix9P1mz5bupvc1UuHk48_wRZ@mail.gmail.com> (raw)
In-Reply-To: <20110317110552.GP22969@localhost>
[-- Attachment #1: Type: text/plain, Size: 911 bytes --]
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?
[-- Attachment #2: Type: text/html, Size: 1264 bytes --]
next prev parent reply other threads:[~2011-03-17 13:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 10:08 [Caml-list] " Pierre-Alexandre Voye
2011-03-17 10:33 ` [Caml-list] " Pierre-Alexandre Voye
2011-03-17 10:47 ` Guillaume Yziquel
2011-03-17 10:50 ` Pierre-Alexandre Voye
2011-03-17 11:01 ` David Rajchenbach-Teller
2011-03-17 11:14 ` David Rajchenbach-Teller
2011-03-17 11:05 ` Guillaume Yziquel
2011-03-17 13:44 ` Gabriel Scherer [this message]
[not found] ` <1080649473.122478.1300369493351.JavaMail.root@zmbs4.inria.fr>
2011-03-17 13:54 ` Fabrice Le Fessant
2011-03-18 17:16 ` Gerd Stolpmann
[not found] ` <350217430.1223639.1300359057593.JavaMail.root@zmbs3.inria.fr>
2011-03-17 11:02 ` Paolo Herms
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimCo-CDsj_tpa9hix9P1mz5bupvc1UuHk48_wRZ@mail.gmail.com \
--to=gabriel.scherer@gmail.com \
--cc=caml-list@inria.fr \
--cc=caml-webmaster@inria.fr \
--cc=guillaume.yziquel@citycable.ch \
--cc=ontologiae@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox