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

Re: "ocaml_beginners"::[] use of modules and functors

Expand Messages
  • bwv211mail
    In the solution you propose, the Bar().upcall function will never be called, since you have fed the Handler module that was fed to Bar() directly to Foo().
    Message 1 of 5 , Apr 18, 2002
    • 0 Attachment
      In the solution you propose, the Bar().upcall function will never be
      called, since you have fed the Handler module that was fed to Bar()
      directly to Foo(). What I want instead is for Bar() to create its own
      Handler module that it can feed to Foo(). The run-time call order
      should be:

      Bar(H_fed_to_Bar).downcall
      Foo(H_fed_to_Foo).downcall
      Foo(H_fed_to_Foo).upcall
      H_fed_to_Foo.upcall
      Bar(H_fed_to_Bar).upcall
      H_fed_to_Bar.upcall

      Maybe this makes the problem clearer?
    • Tom Hirschowitz
      Ok, you want two different handlers. I didn t get that. But it seems that you re in trouble because your graph looks like H_fed_to_Bar
      Message 2 of 5 , Apr 19, 2002
      • 0 Attachment
        Ok, you want two different handlers. I didn't get that.

        But it seems that you're in trouble because your graph looks like

        H_fed_to_Bar <----------- Bar(H_fed_to_Bar)
        ^ |
        | |
        -------------- |
        / |
        / |
        / v
        H_fed_to_Foo <----------- Foo(H_fed_to_Foo)

        Which in this case seems to mean recursive modules, at least if you
        want the code of your functions to be written in their respective modules,
        doesn't it?

        bwv211mail writes:
        > In the solution you propose, the Bar().upcall function will never be
        > called, since you have fed the Handler module that was fed to Bar()
        > directly to Foo(). What I want instead is for Bar() to create its own
        > Handler module that it can feed to Foo(). The run-time call order
        > should be:
        >
        > Bar(H_fed_to_Bar).downcall
        > Foo(H_fed_to_Foo).downcall
        > Foo(H_fed_to_Foo).upcall
        > H_fed_to_Foo.upcall
        > Bar(H_fed_to_Bar).upcall
        > H_fed_to_Bar.upcall
        >
        > Maybe this makes the problem clearer?
        >
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > ocaml_beginners-unsubscribe@yahoogroups.com
        >
        > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
        >
        > Attachments are banned and you're asked to be polite, avoid flames etc. etc.
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >
      • bwv211mail
        ... Yes, I have convinced myself now that my current approach means recursive modules, so I am trying to architect something else. It is a good learning
        Message 3 of 5 , Apr 19, 2002
        • 0 Attachment
          > Which in this case seems to mean recursive modules, at least if you
          > want the code of your functions to be written in their respective
          > modules, doesn't it?

          Yes, I have convinced myself now that my current approach means recursive modules, so I am trying to architect something else. It is a good learning experience.
        Your message has been successfully submitted and would be delivered to recipients shortly.