[Omake] Workaround to support OCaml cyclic dependencies?

Tom Murray yozhik at computer.org
Wed Apr 18 20:22:29 PDT 2007


Sorry, should have done that in the first place:

(* foo.mli *)
type foo_t = {
  foo_num : int ;
  foo_str : string ;
}


val make_foo : int -> string -> foo_t


(* bar.mli *)
type bar_t = {
  bar_num : int ;
  bar_str : string ;
}


val make_bar : int -> string -> bar_t


(* end bar.mli *)

This type of case arises when, say, Foo uses some types in Bar, but Bar uses
some functions in Foo. The easy workaround is to move the shared types to
BarTypes, but I noticed that this sort of thing does compile with ocamlc on
the command line, but couldn't figure out a way to get OMake to do it.

Mostly an academic question, but there are (at least debatable) cases where
this type of structure would make sense.

Thanks,

tm


On 4/18/07, Aleksey Nogin <nogin at metaprl.org> wrote:
>
> On 18.04.2007 14:05, Tom Murray wrote:
>
> > I was wondering if there was a clean workaround to support compilation
> > of OCaml modules with the limited cyclic dependencies allowed by the
> > OCaml compiler.
>
> Tom,
>
> I am not sure I know what kind of cyclic dependencies you mean - can you
> give an example?
>
> Thanks!
>
> Aleksey
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.metaprl.org/pipermail/omake/attachments/20070418/7e37858a/attachment.html


More information about the Omake mailing list