From: "Michael Donat" <donat@intergate.bc.ca>
To: <caml-list@inria.fr>
Subject: Re: cyclic dependencies
Date: Sat, 26 Feb 2000 14:16:55 -0800 [thread overview]
Message-ID: <000801bf80a7$4b62e790$baafc2cf@machiavelli> (raw)
I had a similar problem trying to access some (e.g.) print routines in
another module. My solution probably isn't the most graceful, but instead of
referencing the print routines directly, I accessed them through a
reference. The reference is initialized by the module providing the print
routines.
In other words:
To fix
moduleA:
...
B.print args
...
moduleB:
...
A.something
...
I used
moduleA:
pv = ref stub;;
...
!pv args
...
moduleB:
...
A.pv := print;;
...
A.something
...
Of course, module B is really using a subclass of what it's accessing from
A, so an object approach might be more appealing (and more correct). Since I
only had two functions to deal with, I found the reference approach
acceptable.
Michael Donat
-----Original Message-----
From: Juergen Pfitzenmaier <pfitzen@informatik.uni-tuebingen.de>
To: caml-list@inria.fr <caml-list@inria.fr>
Date: Friday, February 25, 2000 9:30 AM
Subject: cyclic dependencies
>I have a problem with cyclic dependencies between modules. Currently I use
the polymorphic
>member functions of OLabl 2.04 to access the classes in other dependent
modules. But this
>is no longer possible in OCaml 2.99. Any suggestions what to do ?
>
>pfitzen
>
next reply other threads:[~2000-02-28 23:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-26 22:16 Michael Donat [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-02-25 14:01 Juergen Pfitzenmaier
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='000801bf80a7$4b62e790$baafc2cf@machiavelli' \
--to=donat@intergate.bc.ca \
--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