caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* cyclic dependencies
@ 2000-02-25 14:01 Juergen Pfitzenmaier
  0 siblings, 0 replies; 2+ messages in thread
From: Juergen Pfitzenmaier @ 2000-02-25 14:01 UTC (permalink / raw)
  To: caml-list

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cyclic dependencies
@ 2000-02-26 22:16 Michael Donat
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Donat @ 2000-02-26 22:16 UTC (permalink / raw)
  To: caml-list

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
>





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-28 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-25 14:01 cyclic dependencies Juergen Pfitzenmaier
2000-02-26 22:16 Michael Donat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).