9086Re: "ocaml_beginners":: Re: Circular dependencies between modules
- Dec 1, 2007
> If the reference is a function, you can also use this :That is interesting, thanks !
> 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.
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.
- << Previous post in topic Next post in topic >>