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

Re: .mli problems

Expand Messages
  • vincent
    Could you give the corresponding .ml file?
    Message 1 of 12 , Oct 14, 2010
    • 0 Attachment
      Could you give the corresponding .ml file?

      --- In ocaml_beginners@yahoogroups.com, Chris Yocum <cyocum@...> wrote:
      >
      > Hi Everyone,
      >
      > I know that I am probably trying everyone's patience but I am running
      > into an odd problem.
      >
      > For my project, I have an apacheLog.mli file like this:
      >
      > open CalendarLib
      >
      > type log_record
      >
      > val make_log_record : BatRope.t -> BatRope.t -> BatRope.t -> Calendar.t ->
      > BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
      >
      > val parse_from_file : string -> log_record list
      >
      > however, when I try to compile this with its implementation, I get this
      > error:
      >
      > Error: The implementation apacheLog.ml
      > does not match the interface apacheLog.cmi:
      > Values do not match:
      > val parse_from_file : string -> ApacheLog.log_record list
      > is not included in
      > val parse_from_file : string -> log_record list
      >
      > This seems odd to me because type log_record is a part of apacheLog.ml
      > file and should be automatically included because I declared it in the
      > mli file. Is there something basic that I am missing here?
      >
      > Thanks,
      > Chris
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Chris Yocum
      Sure, open BatRope open CalendarLib type log_record = { host : BatRope.t; rfc931 : BatRope.t; username : BatRope.t; date : Calendar.t; request : BatRope.t;
      Message 2 of 12 , Oct 14, 2010
      • 0 Attachment
        Sure,

        open BatRope
        open CalendarLib

        type log_record = {
        host : BatRope.t;
        rfc931 : BatRope.t;
        username : BatRope.t;
        date : Calendar.t;
        request : BatRope.t;
        status : Nethttp.http_status;
        bytes : int;
        referrer : Neturl.url;
        useragent : BatRope.t
        }

        let parse_from_file file_name =
        let file_in = open_in file_name in
        let lexbuf = Lexing.from_channel file_in in
        let log_lst = ApacheLogParse.main ApacheLogLex.token lexbuf in
        let log_filter = function
        Some x -> true
        | None -> false
        in
        BatList.map BatOption.get (BatList.filter log_filter log_lst)

        let make_log_record host rfc931 username date request status bytes referrer
        useragent =
        {host = host; rfc931 = rfc931; username = username; date = date; request =
        request; status = (Nethttp.http_status_of_int status);
        bytes = bytes; referrer = (Neturl.parse_url (BatRope.to_string
        referrer));
        useragent = useragent}

        On 14/10/10 14:45, vincent wrote:
        >
        >
        >
        > Could you give the corresponding .ml file?
        >
        > --- In ocaml_beginners@yahoogroups.com
        > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum <cyocum@...> wrote:
        >>
        >> Hi Everyone,
        >>
        >> I know that I am probably trying everyone's patience but I am running
        >> into an odd problem.
        >>
        >> For my project, I have an apacheLog.mli file like this:
        >>
        >> open CalendarLib
        >>
        >> type log_record
        >>
        >> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t -> Calendar.t ->
        >> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
        >>
        >> val parse_from_file : string -> log_record list
        >>
        >> however, when I try to compile this with its implementation, I get this
        >> error:
        >>
        >> Error: The implementation apacheLog.ml
        >> does not match the interface apacheLog.cmi:
        >> Values do not match:
        >> val parse_from_file : string -> ApacheLog.log_record list
        >> is not included in
        >> val parse_from_file : string -> log_record list
        >>
        >> This seems odd to me because type log_record is a part of apacheLog.ml
        >> file and should be automatically included because I declared it in the
        >> mli file. Is there something basic that I am missing here?
        >>
        >> Thanks,
        >> Chris
        >>
        >>
        >>
        >> [Non-text portions of this message have been removed]
        >>
        >
        >



        [Non-text portions of this message have been removed]
      • Sylvain Le Gall
        ... Do you define log_record anywhere else? Could you publish the whole source tree somewher? It seems that this is a simple problem of make clean before
        Message 3 of 12 , Oct 14, 2010
        • 0 Attachment
          On 14-10-2010, Chris Yocum <cyocum@...> wrote:
          >
          > type log_record = {
          > host : BatRope.t;
          > rfc931 : BatRope.t;
          > username : BatRope.t;
          > date : Calendar.t;
          > request : BatRope.t;
          > status : Nethttp.http_status;
          > bytes : int;
          > referrer : Neturl.url;
          > useragent : BatRope.t
          > }
          >
          >>> type log_record
          >>>
          >>> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t -> Calendar.t ->
          >>> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
          >>>
          >>> val parse_from_file : string -> log_record list
          >>>
          >>> however, when I try to compile this with its implementation, I get this
          >>> error:
          >>>
          >>> Error: The implementation apacheLog.ml
          >>> does not match the interface apacheLog.cmi:
          >>> Values do not match:
          >>> val parse_from_file : string -> ApacheLog.log_record list
          >>> is not included in
          >>> val parse_from_file : string -> log_record list
          >>>

          Do you define log_record anywhere else?

          Could you publish the whole source tree somewher?

          It seems that this is a simple problem of "make clean" before
          rebuilding.

          Regards
          Sylvain Le Gall
        • Chris Yocum
          Hi Sylvian, The source is over at github (http://github.com/cyocum/OPLP) please feel free to have a look. I have done a make clean as well so I am unsure what
          Message 4 of 12 , Oct 14, 2010
          • 0 Attachment
            Hi Sylvian,

            The source is over at github (http://github.com/cyocum/OPLP) please feel
            free to have a look. I have done a make clean as well so I am unsure
            what is going on here.

            Thanks for your time and consideration.

            All the best,
            Chris

            On 14/10/10 15:27, Sylvain Le Gall wrote:
            >
            >
            > On 14-10-2010, Chris Yocum <cyocum@...
            > <mailto:cyocum%40gmail.com>> wrote:
            >>
            >> type log_record = {
            >> host : BatRope.t;
            >> rfc931 : BatRope.t;
            >> username : BatRope.t;
            >> date : Calendar.t;
            >> request : BatRope.t;
            >> status : Nethttp.http_status;
            >> bytes : int;
            >> referrer : Neturl.url;
            >> useragent : BatRope.t
            >> }
            >>
            >>>> type log_record
            >>>>
            >>>> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t ->
            > Calendar.t ->
            >>>> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
            >>>>
            >>>> val parse_from_file : string -> log_record list
            >>>>
            >>>> however, when I try to compile this with its implementation, I get this
            >>>> error:
            >>>>
            >>>> Error: The implementation apacheLog.ml
            >>>> does not match the interface apacheLog.cmi:
            >>>> Values do not match:
            >>>> val parse_from_file : string -> ApacheLog.log_record list
            >>>> is not included in
            >>>> val parse_from_file : string -> log_record list
            >>>>
            >
            > Do you define log_record anywhere else?
            >
            > Could you publish the whole source tree somewher?
            >
            > It seems that this is a simple problem of "make clean" before
            > rebuilding.
            >
            > Regards
            > Sylvain Le Gall
            >
            >



            [Non-text portions of this message have been removed]
          • vincent
            I can t compile your source tree because I don t have all the libs you use (they re downloading :). But at first sight, I have the feeling that you should get
            Message 5 of 12 , Oct 14, 2010
            • 0 Attachment
              I can't compile your source tree because I don't have all the libs you use (they're downloading :). But at first sight, I have the feeling that you should get a problem at comiplation because ApacheLog depends on ApacheLogParse and conversely. There should be a cyclic dependency there.

              --- In ocaml_beginners@yahoogroups.com, Chris Yocum <cyocum@...> wrote:
              >
              > Sure,
              >
              > open BatRope
              > open CalendarLib
              >
              > type log_record = {
              > host : BatRope.t;
              > rfc931 : BatRope.t;
              > username : BatRope.t;
              > date : Calendar.t;
              > request : BatRope.t;
              > status : Nethttp.http_status;
              > bytes : int;
              > referrer : Neturl.url;
              > useragent : BatRope.t
              > }
              >
              > let parse_from_file file_name =
              > let file_in = open_in file_name in
              > let lexbuf = Lexing.from_channel file_in in
              > let log_lst = ApacheLogParse.main ApacheLogLex.token lexbuf in
              > let log_filter = function
              > Some x -> true
              > | None -> false
              > in
              > BatList.map BatOption.get (BatList.filter log_filter log_lst)
              >
              > let make_log_record host rfc931 username date request status bytes referrer
              > useragent =
              > {host = host; rfc931 = rfc931; username = username; date = date; request =
              > request; status = (Nethttp.http_status_of_int status);
              > bytes = bytes; referrer = (Neturl.parse_url (BatRope.to_string
              > referrer));
              > useragent = useragent}
              >
              > On 14/10/10 14:45, vincent wrote:
              > >
              > >
              > >
              > > Could you give the corresponding .ml file?
              > >
              > > --- In ocaml_beginners@yahoogroups.com
              > > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum <cyocum@> wrote:
              > >>
              > >> Hi Everyone,
              > >>
              > >> I know that I am probably trying everyone's patience but I am running
              > >> into an odd problem.
              > >>
              > >> For my project, I have an apacheLog.mli file like this:
              > >>
              > >> open CalendarLib
              > >>
              > >> type log_record
              > >>
              > >> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t -> Calendar.t ->
              > >> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
              > >>
              > >> val parse_from_file : string -> log_record list
              > >>
              > >> however, when I try to compile this with its implementation, I get this
              > >> error:
              > >>
              > >> Error: The implementation apacheLog.ml
              > >> does not match the interface apacheLog.cmi:
              > >> Values do not match:
              > >> val parse_from_file : string -> ApacheLog.log_record list
              > >> is not included in
              > >> val parse_from_file : string -> log_record list
              > >>
              > >> This seems odd to me because type log_record is a part of apacheLog.ml
              > >> file and should be automatically included because I declared it in the
              > >> mli file. Is there something basic that I am missing here?
              > >>
              > >> Thanks,
              > >> Chris
              > >>
              > >>
              > >>
              > >> [Non-text portions of this message have been removed]
              > >>
              > >
              > >
              >
              >
              >
              > [Non-text portions of this message have been removed]
              >
            • vincent
              That s it: $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc apacheLogParse.mly ocamlfind ocamlc -package
              Message 6 of 12 , Oct 14, 2010
              • 0 Attachment
                That's it:
                $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc
                apacheLogParse.mly ocamlfind ocamlc -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -c apacheLog.mli ocamlfind ocamlc -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -c apacheLogParse.mli ocamlfind ocamlopt -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                apacheLog.ml main.ml
                You kinda cheated her because you compile your apacheLog.mli before the
                apacheLog.ml file (third line). I guess prescisely to circumvent the
                problem of circular dependency, isn't it? As a consequence, the .cmi
                file that you obtain after the third command dos not match the .cmx file
                obtained in the last command.
                The first step in the solution is to remove the third and fourth line,
                then you should get the following error:$ make buildocamllex
                apacheLogLex.mll23 states, 497 transitions, table size 2126
                bytesocamlyacc apacheLogParse.mly#ocamlfind ocamlc -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -c apacheLog.mli#ocamlfind ocamlc -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -c apacheLogParse.mliocamlfind ocamlopt -package
                batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                apacheLog.ml main.mlfindlib: [WARNING] Package estring has multiple
                definitions in /opt/godi/lib/ocaml/pkg-lib/estring/META,
                /opt/godi/lib/ocaml/site-lib/estring/METAFile "apacheLogParse.mly", line
                2, characters 2-16:Error: Unbound module ApacheLogmake: *** [build]
                Error 2
                you have an error again, but this time it is meaningful.Now you can see
                the real problem and the good way to go to solve it:-> Remove this
                mutual dependency between ApacheLog and ApacheLogParse (and don't
                hesitate to get back to us if this raises other problems).
                Cheers,Vincent
                --- In ocaml_beginners@yahoogroups.com, "vincent"
                <vincent.aravantinos@...> wrote:
                >
                > I can't compile your source tree because I don't have all the libs you
                use (they're downloading :). But at first sight, I have the feeling that
                you should get a problem at comiplation because ApacheLog depends on
                ApacheLogParse and conversely. There should be a cyclic dependency
                there.
                >
                > --- In ocaml_beginners@yahoogroups.com, Chris Yocum cyocum@ wrote:
                > >
                > > Sure,
                > >
                > > open BatRope
                > > open CalendarLib
                > >
                > > type log_record = {
                > > host : BatRope.t;
                > > rfc931 : BatRope.t;
                > > username : BatRope.t;
                > > date : Calendar.t;
                > > request : BatRope.t;
                > > status : Nethttp.http_status;
                > > bytes : int;
                > > referrer : Neturl.url;
                > > useragent : BatRope.t
                > > }
                > >
                > > let parse_from_file file_name =
                > > let file_in = open_in file_name in
                > > let lexbuf = Lexing.from_channel file_in in
                > > let log_lst = ApacheLogParse.main ApacheLogLex.token lexbuf in
                > > let log_filter = function
                > > Some x -> true
                > > | None -> false
                > > in
                > > BatList.map BatOption.get (BatList.filter log_filter log_lst)
                > >
                > > let make_log_record host rfc931 username date request status bytes
                referrer
                > > useragent =
                > > {host = host; rfc931 = rfc931; username = username; date = date;
                request =
                > > request; status = (Nethttp.http_status_of_int status);
                > > bytes = bytes; referrer = (Neturl.parse_url (BatRope.to_string
                > > referrer));
                > > useragent = useragent}
                > >
                > > On 14/10/10 14:45, vincent wrote:
                > > >
                > > >
                > > >
                > > > Could you give the corresponding .ml file?
                > > >
                > > > --- In ocaml_beginners@yahoogroups.com
                > > > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum <cyocum@>
                wrote:
                > > >>
                > > >> Hi Everyone,
                > > >>
                > > >> I know that I am probably trying everyone's patience but I am
                running
                > > >> into an odd problem.
                > > >>
                > > >> For my project, I have an apacheLog.mli file like this:
                > > >>
                > > >> open CalendarLib
                > > >>
                > > >> type log_record
                > > >>
                > > >> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t ->
                Calendar.t ->
                > > >> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
                > > >>
                > > >> val parse_from_file : string -> log_record list
                > > >>
                > > >> however, when I try to compile this with its implementation, I
                get this
                > > >> error:
                > > >>
                > > >> Error: The implementation apacheLog.ml
                > > >> does not match the interface apacheLog.cmi:
                > > >> Values do not match:
                > > >> val parse_from_file : string -> ApacheLog.log_record list
                > > >> is not included in
                > > >> val parse_from_file : string -> log_record list
                > > >>
                > > >> This seems odd to me because type log_record is a part of
                apacheLog.ml
                > > >> file and should be automatically included because I declared it
                in the
                > > >> mli file. Is there something basic that I am missing here?
                > > >>
                > > >> Thanks,
                > > >> Chris
                > > >>
                > > >>
                > > >>
                > > >> [Non-text portions of this message have been removed]
                > > >>
                > > >
                > > >
                > >
                > >
                > >
                > > [Non-text portions of this message have been removed]
                > >
                >



                [Non-text portions of this message have been removed]
              • vincent
                (resending due to crazy formating) That s it: $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc apacheLogParse.mly ocamlfind ocamlc -package
                Message 7 of 12 , Oct 14, 2010
                • 0 Attachment
                  (resending due to crazy formating)

                  That's it:

                  $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc
                  apacheLogParse.mly ocamlfind ocamlc -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -c apacheLog.mli ocamlfind ocamlc -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -c apacheLogParse.mli ocamlfind ocamlopt -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                  apacheLog.ml main.ml

                  You kinda cheated her because you compile your apacheLog.mli before the
                  apacheLog.ml file (third line). I guess prescisely to circumvent the
                  problem of circular dependency, isn't it? As a consequence, the .cmi
                  file that you obtain after the third command dos not match the .cmx file
                  obtained in the last command.

                  The first step to the solution is to remove the third and fourth line,
                  then you should get the following error:

                  $make buildocamllex
                  apacheLogLex.mll23 states, 497 transitions, table size 2126
                  bytesocamlyacc apacheLogParse.mly#ocamlfind ocamlc -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -c apacheLog.mli#ocamlfind ocamlc -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -c apacheLogParse.mliocamlfind ocamlopt -package
                  batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                  apacheLog.ml main.mlfindlib: [WARNING] Package estring has multiple
                  definitions in /opt/godi/lib/ocaml/pkg-lib/estring/META,
                  /opt/godi/lib/ocaml/site-lib/estring/METAFile "apacheLogParse.mly", line
                  2, characters 2-16:Error: Unbound module ApacheLogmake: *** [build]
                  Error 2

                  -> You have an error again, but this time it is meaningful. Now you can see
                  the real problem and the good way to go to solve it:
                  -> Remove this mutual dependency between ApacheLog and ApacheLogParse (and don't
                  hesitate to get back to us if this raises other problems).

                  Cheers,
                  Vincent


                  --- In ocaml_beginners@yahoogroups.com, "vincent" <vincent.aravantinos@...> wrote:
                  >
                  > That's it:
                  > $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc
                  > apacheLogParse.mly ocamlfind ocamlc -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -c apacheLog.mli ocamlfind ocamlc -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -c apacheLogParse.mli ocamlfind ocamlopt -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                  > apacheLog.ml main.ml
                  > You kinda cheated her because you compile your apacheLog.mli before the
                  > apacheLog.ml file (third line). I guess prescisely to circumvent the
                  > problem of circular dependency, isn't it? As a consequence, the .cmi
                  > file that you obtain after the third command dos not match the .cmx file
                  > obtained in the last command.
                  > The first step in the solution is to remove the third and fourth line,
                  > then you should get the following error:$ make buildocamllex
                  > apacheLogLex.mll23 states, 497 transitions, table size 2126
                  > bytesocamlyacc apacheLogParse.mly#ocamlfind ocamlc -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -c apacheLog.mli#ocamlfind ocamlc -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -c apacheLogParse.mliocamlfind ocamlopt -package
                  > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                  > camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                  > apacheLog.ml main.mlfindlib: [WARNING] Package estring has multiple
                  > definitions in /opt/godi/lib/ocaml/pkg-lib/estring/META,
                  > /opt/godi/lib/ocaml/site-lib/estring/METAFile "apacheLogParse.mly", line
                  > 2, characters 2-16:Error: Unbound module ApacheLogmake: *** [build]
                  > Error 2
                  > you have an error again, but this time it is meaningful.Now you can see
                  > the real problem and the good way to go to solve it:-> Remove this
                  > mutual dependency between ApacheLog and ApacheLogParse (and don't
                  > hesitate to get back to us if this raises other problems).
                  > Cheers,Vincent
                  > --- In ocaml_beginners@yahoogroups.com, "vincent"
                  > <vincent.aravantinos@> wrote:
                  > >
                  > > I can't compile your source tree because I don't have all the libs you
                  > use (they're downloading :). But at first sight, I have the feeling that
                  > you should get a problem at comiplation because ApacheLog depends on
                  > ApacheLogParse and conversely. There should be a cyclic dependency
                  > there.
                  > >
                  > > --- In ocaml_beginners@yahoogroups.com, Chris Yocum cyocum@ wrote:
                  > > >
                  > > > Sure,
                  > > >
                  > > > open BatRope
                  > > > open CalendarLib
                  > > >
                  > > > type log_record = {
                  > > > host : BatRope.t;
                  > > > rfc931 : BatRope.t;
                  > > > username : BatRope.t;
                  > > > date : Calendar.t;
                  > > > request : BatRope.t;
                  > > > status : Nethttp.http_status;
                  > > > bytes : int;
                  > > > referrer : Neturl.url;
                  > > > useragent : BatRope.t
                  > > > }
                  > > >
                  > > > let parse_from_file file_name =
                  > > > let file_in = open_in file_name in
                  > > > let lexbuf = Lexing.from_channel file_in in
                  > > > let log_lst = ApacheLogParse.main ApacheLogLex.token lexbuf in
                  > > > let log_filter = function
                  > > > Some x -> true
                  > > > | None -> false
                  > > > in
                  > > > BatList.map BatOption.get (BatList.filter log_filter log_lst)
                  > > >
                  > > > let make_log_record host rfc931 username date request status bytes
                  > referrer
                  > > > useragent =
                  > > > {host = host; rfc931 = rfc931; username = username; date = date;
                  > request =
                  > > > request; status = (Nethttp.http_status_of_int status);
                  > > > bytes = bytes; referrer = (Neturl.parse_url (BatRope.to_string
                  > > > referrer));
                  > > > useragent = useragent}
                  > > >
                  > > > On 14/10/10 14:45, vincent wrote:
                  > > > >
                  > > > >
                  > > > >
                  > > > > Could you give the corresponding .ml file?
                  > > > >
                  > > > > --- In ocaml_beginners@yahoogroups.com
                  > > > > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum <cyocum@>
                  > wrote:
                  > > > >>
                  > > > >> Hi Everyone,
                  > > > >>
                  > > > >> I know that I am probably trying everyone's patience but I am
                  > running
                  > > > >> into an odd problem.
                  > > > >>
                  > > > >> For my project, I have an apacheLog.mli file like this:
                  > > > >>
                  > > > >> open CalendarLib
                  > > > >>
                  > > > >> type log_record
                  > > > >>
                  > > > >> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t ->
                  > Calendar.t ->
                  > > > >> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
                  > > > >>
                  > > > >> val parse_from_file : string -> log_record list
                  > > > >>
                  > > > >> however, when I try to compile this with its implementation, I
                  > get this
                  > > > >> error:
                  > > > >>
                  > > > >> Error: The implementation apacheLog.ml
                  > > > >> does not match the interface apacheLog.cmi:
                  > > > >> Values do not match:
                  > > > >> val parse_from_file : string -> ApacheLog.log_record list
                  > > > >> is not included in
                  > > > >> val parse_from_file : string -> log_record list
                  > > > >>
                  > > > >> This seems odd to me because type log_record is a part of
                  > apacheLog.ml
                  > > > >> file and should be automatically included because I declared it
                  > in the
                  > > > >> mli file. Is there something basic that I am missing here?
                  > > > >>
                  > > > >> Thanks,
                  > > > >> Chris
                  > > > >>
                  > > > >>
                  > > > >>
                  > > > >> [Non-text portions of this message have been removed]
                  > > > >>
                  > > > >
                  > > > >
                  > > >
                  > > >
                  > > >
                  > > > [Non-text portions of this message have been removed]
                  > > >
                  > >
                  >
                  >
                  >
                  > [Non-text portions of this message have been removed]
                  >
                • Chris Yocum
                  Great! Thank you very much Vincent. I will do as you suggest. I had moved the parsing function into ApacheLog which triggered the circular dependency. Chris
                  Message 8 of 12 , Oct 14, 2010
                  • 0 Attachment
                    Great! Thank you very much Vincent. I will do as you suggest. I had
                    moved the parsing function into ApacheLog which triggered the circular
                    dependency.

                    Chris

                    On 14/10/10 15:58, vincent wrote:
                    >
                    >
                    >
                    >
                    > (resending due to crazy formating)
                    >
                    > That's it:
                    >
                    > $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc
                    > apacheLogParse.mly ocamlfind ocamlc -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -c apacheLog.mli ocamlfind ocamlc -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -c apacheLogParse.mli ocamlfind ocamlopt -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                    > apacheLog.ml main.ml
                    >
                    > You kinda cheated her because you compile your apacheLog.mli before the
                    > apacheLog.ml file (third line). I guess prescisely to circumvent the
                    > problem of circular dependency, isn't it? As a consequence, the .cmi
                    > file that you obtain after the third command dos not match the .cmx file
                    > obtained in the last command.
                    >
                    > The first step to the solution is to remove the third and fourth line,
                    > then you should get the following error:
                    >
                    > $make buildocamllex
                    > apacheLogLex.mll23 states, 497 transitions, table size 2126
                    > bytesocamlyacc apacheLogParse.mly#ocamlfind ocamlc -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -c apacheLog.mli#ocamlfind ocamlc -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -c apacheLogParse.mliocamlfind ocamlopt -package
                    > batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    > camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                    > apacheLog.ml main.mlfindlib: [WARNING] Package estring has multiple
                    > definitions in /opt/godi/lib/ocaml/pkg-lib/estring/META,
                    > /opt/godi/lib/ocaml/site-lib/estring/METAFile "apacheLogParse.mly", line
                    > 2, characters 2-16:Error: Unbound module ApacheLogmake: *** [build]
                    > Error 2
                    >
                    > -> You have an error again, but this time it is meaningful. Now you can see
                    > the real problem and the good way to go to solve it:
                    > -> Remove this mutual dependency between ApacheLog and ApacheLogParse
                    > (and don't
                    > hesitate to get back to us if this raises other problems).
                    >
                    > Cheers,
                    > Vincent
                    >
                    > --- In ocaml_beginners@yahoogroups.com
                    > <mailto:ocaml_beginners%40yahoogroups.com>, "vincent"
                    > <vincent.aravantinos@...> wrote:
                    >>
                    >> That's it:
                    >> $cat Makefilebuild: ocamllex apacheLogLex.mll ocamlyacc
                    >> apacheLogParse.mly ocamlfind ocamlc -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -c apacheLog.mli ocamlfind ocamlc -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -c apacheLogParse.mli ocamlfind ocamlopt -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                    >> apacheLog.ml main.ml
                    >> You kinda cheated her because you compile your apacheLog.mli before the
                    >> apacheLog.ml file (third line). I guess prescisely to circumvent the
                    >> problem of circular dependency, isn't it? As a consequence, the .cmi
                    >> file that you obtain after the third command dos not match the .cmx file
                    >> obtained in the last command.
                    >> The first step in the solution is to remove the third and fourth line,
                    >> then you should get the following error:$ make buildocamllex
                    >> apacheLogLex.mll23 states, 497 transitions, table size 2126
                    >> bytesocamlyacc apacheLogParse.mly#ocamlfind ocamlc -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -c apacheLog.mli#ocamlfind ocamlc -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -c apacheLogParse.mliocamlfind ocamlopt -package
                    >> batteries,batteries.pa_string.syntax,netstring,calendar -linkpkg -syntax
                    >> camlp4o -o test_apache_parse apacheLogParse.ml apacheLogLex.ml
                    >> apacheLog.ml main.mlfindlib: [WARNING] Package estring has multiple
                    >> definitions in /opt/godi/lib/ocaml/pkg-lib/estring/META,
                    >> /opt/godi/lib/ocaml/site-lib/estring/METAFile "apacheLogParse.mly", line
                    >> 2, characters 2-16:Error: Unbound module ApacheLogmake: *** [build]
                    >> Error 2
                    >> you have an error again, but this time it is meaningful.Now you can see
                    >> the real problem and the good way to go to solve it:-> Remove this
                    >> mutual dependency between ApacheLog and ApacheLogParse (and don't
                    >> hesitate to get back to us if this raises other problems).
                    >> Cheers,Vincent
                    >> --- In ocaml_beginners@yahoogroups.com
                    > <mailto:ocaml_beginners%40yahoogroups.com>, "vincent"
                    >> <vincent.aravantinos@> wrote:
                    >> >
                    >> > I can't compile your source tree because I don't have all the libs you
                    >> use (they're downloading :). But at first sight, I have the feeling that
                    >> you should get a problem at comiplation because ApacheLog depends on
                    >> ApacheLogParse and conversely. There should be a cyclic dependency
                    >> there.
                    >> >
                    >> > --- In ocaml_beginners@yahoogroups.com
                    > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum cyocum@ wrote:
                    >> > >
                    >> > > Sure,
                    >> > >
                    >> > > open BatRope
                    >> > > open CalendarLib
                    >> > >
                    >> > > type log_record = {
                    >> > > host : BatRope.t;
                    >> > > rfc931 : BatRope.t;
                    >> > > username : BatRope.t;
                    >> > > date : Calendar.t;
                    >> > > request : BatRope.t;
                    >> > > status : Nethttp.http_status;
                    >> > > bytes : int;
                    >> > > referrer : Neturl.url;
                    >> > > useragent : BatRope.t
                    >> > > }
                    >> > >
                    >> > > let parse_from_file file_name =
                    >> > > let file_in = open_in file_name in
                    >> > > let lexbuf = Lexing.from_channel file_in in
                    >> > > let log_lst = ApacheLogParse.main ApacheLogLex.token lexbuf in
                    >> > > let log_filter = function
                    >> > > Some x -> true
                    >> > > | None -> false
                    >> > > in
                    >> > > BatList.map BatOption.get (BatList.filter log_filter log_lst)
                    >> > >
                    >> > > let make_log_record host rfc931 username date request status bytes
                    >> referrer
                    >> > > useragent =
                    >> > > {host = host; rfc931 = rfc931; username = username; date = date;
                    >> request =
                    >> > > request; status = (Nethttp.http_status_of_int status);
                    >> > > bytes = bytes; referrer = (Neturl.parse_url (BatRope.to_string
                    >> > > referrer));
                    >> > > useragent = useragent}
                    >> > >
                    >> > > On 14/10/10 14:45, vincent wrote:
                    >> > > >
                    >> > > >
                    >> > > >
                    >> > > > Could you give the corresponding .ml file?
                    >> > > >
                    >> > > > --- In ocaml_beginners@yahoogroups.com
                    > <mailto:ocaml_beginners%40yahoogroups.com>
                    >> > > > <mailto:ocaml_beginners%40yahoogroups.com>, Chris Yocum <cyocum@>
                    >> wrote:
                    >> > > >>
                    >> > > >> Hi Everyone,
                    >> > > >>
                    >> > > >> I know that I am probably trying everyone's patience but I am
                    >> running
                    >> > > >> into an odd problem.
                    >> > > >>
                    >> > > >> For my project, I have an apacheLog.mli file like this:
                    >> > > >>
                    >> > > >> open CalendarLib
                    >> > > >>
                    >> > > >> type log_record
                    >> > > >>
                    >> > > >> val make_log_record : BatRope.t -> BatRope.t -> BatRope.t ->
                    >> Calendar.t ->
                    >> > > >> BatRope.t -> int -> int -> BatRope.t -> BatRope.t -> log_record
                    >> > > >>
                    >> > > >> val parse_from_file : string -> log_record list
                    >> > > >>
                    >> > > >> however, when I try to compile this with its implementation, I
                    >> get this
                    >> > > >> error:
                    >> > > >>
                    >> > > >> Error: The implementation apacheLog.ml
                    >> > > >> does not match the interface apacheLog.cmi:
                    >> > > >> Values do not match:
                    >> > > >> val parse_from_file : string -> ApacheLog.log_record list
                    >> > > >> is not included in
                    >> > > >> val parse_from_file : string -> log_record list
                    >> > > >>
                    >> > > >> This seems odd to me because type log_record is a part of
                    >> apacheLog.ml
                    >> > > >> file and should be automatically included because I declared it
                    >> in the
                    >> > > >> mli file. Is there something basic that I am missing here?
                    >> > > >>
                    >> > > >> Thanks,
                    >> > > >> Chris
                    >> > > >>
                    >> > > >>
                    >> > > >>
                    >> > > >> [Non-text portions of this message have been removed]
                    >> > > >>
                    >> > > >
                    >> > > >
                    >> > >
                    >> > >
                    >> > >
                    >> > > [Non-text portions of this message have been removed]
                    >> > >
                    >> >
                    >>
                    >>
                    >>
                    >> [Non-text portions of this message have been removed]
                    >>
                    >
                    >



                    [Non-text portions of this message have been removed]
                  • Sylvain Le Gall
                    ... You create a circular build dependencies between ApacheLog and ApacheLogParse. There is probably a better way, but the most simple solution is to create a
                    Message 9 of 12 , Oct 14, 2010
                    • 0 Attachment
                      On 14-10-2010, Chris Yocum <cyocum@...> wrote:
                      > Hi Sylvian,
                      >
                      > The source is over at github (http://github.com/cyocum/OPLP) please feel
                      > free to have a look. I have done a make clean as well so I am unsure
                      > what is going on here.
                      >
                      > Thanks for your time and consideration.
                      >

                      You create a circular build dependencies between ApacheLog and
                      ApacheLogParse. There is probably a better way, but the most simple
                      solution is to create a 3rd files ApacheLogCommon that contains the "type
                      log_record" and "make_log_record" and refers to it.

                      Regards,
                      Sylvain Le Gall
                    • Gaius Hammond
                      ... The bad news is: no The good news is: the developers are great, I m sure if you have a specific question they d be happy to help
                      Message 10 of 12 , Oct 14, 2010
                      • 0 Attachment
                        On 14 Oct 2010, at 08:55, Mihamina Rakotomandimby wrote:

                        > Manao ahoana, Hello, Bonjour,
                        >
                        > Do you know any entry level tutorial for:
                        > http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=546
                        > .
                        >
                        >
                        >



                        The bad news is: no



                        The good news is: the developers are great, I'm sure if you have a
                        specific question they'd be happy to help



                        http://gaiustech.wordpress.com/2010/09/27/api-documentation/



                        Cheers,



                        G




                        [Non-text portions of this message have been removed]
                      Your message has been successfully submitted and would be delivered to recipients shortly.