Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@best.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Markus Mottl <mottl@miss.wu-wien.ac.at>, caml-list@inria.fr
Subject: Re: Using modules and classes recursively
Date: Tue, 12 Jan 1999 10:49:59 -0800 (PST)	[thread overview]
Message-ID: <Pine.BSF.4.05.9901121012350.24045-100000@shell5.ba.best.com> (raw)
In-Reply-To: <19990112182919.00681@pauillac.inria.fr>

On Tue, 12 Jan 1999, Xavier Leroy wrote:
> > Is it impossible to have modules and classes combined recursively?
> 
> Currently, yes.  A module definition cannot be mutually recursive with
> any other definition (type, class, or another module).  This raises a
> number of difficult typechecking and compilation problems that are
> still largely open.  I agree this is probably the most irritating
> restriction of ML modules.

A similar restriction also exists in Ada, i.e., two package specifications
cannot "with" (open) each other. One workaround for the case where you
have mutually dependant tagged types (classes) in separate package specs
is to break the cycle by creating a dummy parent type for each of the 
dependant tagged types and using those in place of the type which would 
cause the problem, in this case a "foo_dummy_parent set" would replace foo
in the problem spots, foo would inherit from foo_dummy_parent and the
foos that go into the set would have to be coerced to foo_dummy_parent.

I think this trick will work in OCaml too, but I haven't tried.

-- Brian

PS: For the Ada aware Camlists (Camlers?),

	http://www.bluemarble.net/~jvolan/WithingProblem/FAQ.html

    is a long discussion of the problem in Ada.




  reply	other threads:[~1999-01-13 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-09 20:24 Markus Mottl
1999-01-12 17:29 ` Xavier Leroy
1999-01-12 18:49   ` Brian Rogoff [this message]
1999-01-12 19:20     ` Markus Mottl

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=Pine.BSF.4.05.9901121012350.24045-100000@shell5.ba.best.com \
    --to=bpr@best.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mottl@miss.wu-wien.ac.at \
    /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