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

Re: "ocaml_beginners"::[] Re: module rec

Expand Messages
  • dmitry grebeniuk
    Shalom, code17. c I roughly understand your situation, but I don t c understand the design, especially the reason why you want c the state_t type
    Message 1 of 6 , Jan 31, 2007
    • 0 Attachment
      Shalom, code17.

      c> I roughly understand your situation, but I don't
      c> understand the design, especially the reason why you want
      c> the state_t type private (or opaque) to all other inside
      c> modules. If all these modules are programmed by you, why
      c> do you care whether they can operate over state_t type
      c> directly?

      I want the compiler to check my code, because it really
      guarantees that state_t can be created/modified only in one
      small module. This module can be fully and quickly checked
      without reviewing other parts of my code.

      I don't need the cool feature "private type", I could be
      satisfied by opaque state_t, but I can't declare it as
      opaque type because of the structure of my code, described
      in previous letter (functions that work with state_t
      requires some functions that work with my_struct).

      --
      WBR,
      dmitry mailto:gds-mlsts@...
    • code17
      Then I guess there is no other solution other than recursive module, because it s actually recursive: Mod1 and Mod2 depends my_struct and hence must see
      Message 2 of 6 , Feb 1, 2007
      • 0 Attachment
        Then I guess there is no other solution other than recursive module, because
        it's actually recursive: Mod1 and Mod2 depends my_struct and hence must see
        state_t, while the module State where state_t should be defined in also
        depends on Mod1 and Mod2.

        Unless you can try to factor out the parts in Mod1 and Mod2 on which State
        depends and move them into State, but it really depends.

        Good luck!

        - code17

        dmitry grebeniuk <gds-mlsts@...> writes:
        > I want the compiler to check my code, because it really
        > guarantees that state_t can be created/modified only in one
        > small module. This module can be fully and quickly checked
        > without reviewing other parts of my code.
        >
        > I don't need the cool feature "private type", I could be
        > satisfied by opaque state_t, but I can't declare it as
        > opaque type because of the structure of my code, described
        > in previous letter (functions that work with state_t
        > requires some functions that work with my_struct).
      Your message has been successfully submitted and would be delivered to recipients shortly.