Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: akay@sharp.co.uk (Andrew Kay)
Cc: caml-list@inria.fr (OCAML)
Subject: Re: mutually recursive types and modules
Date: Wed, 12 May 1999 19:04:56 +0100 (MET DST)	[thread overview]
Message-ID: <199905121704.TAA26997@miss.wu-wien.ac.at> (raw)
In-Reply-To: <199905111632.RAA19705@byrd.sle.sharp.co.uk> from "Andrew Kay" at May 11, 99 05:32:17 pm

> So far so good.  Next we realised that we don't care about the order of
> edges in the edge list, and we are always converting edge lists into sets
> to do union operations and so on, so we decided to recode the node type
> with edges as sets for efficiency (which is very important here).
> 
> * type node = {
> *             node_id : int;
> *             mutable edges : NodeSet.t;
> *             ... (other fields)
> * 	      }
> 
> At this point the world seemed to spin and make me dizzy, because we can't
> defined NodeSet without node, and we can't define node without NodeSet.
> I can't see any way to express this in OCaml.

Unfortunately, there is no way to do this (yet). You might want to take
a look at the following thread in the archive of the OCAML-mailing-list,
where Xavier Leroy explains the problem:

  http://pauillac.inria.fr/caml/caml-list/0896.html

In my case it was the combination of classes and modules in a recursive
way, which also doesn't work.

There is no short workaround. I solved my problem by redesigning the
system so that it does not require mutual recursive definitions - it's
ok, but not as elegant as it could have been without this restriction.

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl




  parent reply	other threads:[~1999-05-14 10:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-11 16:32 Andrew Kay
1999-05-12 16:55 ` Benoit deBoursetty
1999-05-12 18:04 ` Markus Mottl [this message]
1999-05-14 11:11 ` Francisco Valverde Albacete

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=199905121704.TAA26997@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=akay@sharp.co.uk \
    --cc=caml-list@inria.fr \
    /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