Loading ...
Sorry, an error occurred while loading the content.

9086Re: "ocaml_beginners"::[] Re: Circular dependencies between modules

Expand Messages
  • Fabrice Marchant
    Dec 1, 2007
    • 0 Attachment
      > If the reference is a function, you can also use this :
      >
      > in one.ml:
      > let f : (int -> string -> string) ref =
      > ref(fun _ _ _ -> failwith "not implemented yet")
      >
      > in two.ml
      >
      > let f x y z = "do the real stuff"
      >
      > One.f := f
      >
      > There is several problem with this:
      > - you need to explicitly give the type of f in one.ml,
      > - this type must not be polymorphic.
      > - this will only work with function.

      That is interesting, thanks !

      But It makes me think to this now :
      even forgetting these circular dependencies, IMHO any initialization of a reference that isn't available at compile time seems to be a problem.

      Regards,

      Fabrice
    • Show all 15 messages in this topic