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

ocaml libraries and using your own

Expand Messages
  • bwv211mail
    Hi. Do the ocaml tools do something special with respect to the standard libraries? I m wondering why we don t have to specify them on the command line. I
    Message 1 of 2 , Jul 2, 2002
    • 0 Attachment
      Hi. Do the ocaml tools do something special with respect to the
      standard libraries? I'm wondering why we don't have to specify them
      on the command line. I would like to have my own "local standard"
      libraries that are automagically searched for, but I can't find a
      way to do it - I always have to end up specifying "mylib.cma" or
      "mylib.cmxa" on the command line... it finds the .cmi files all
      right without anything but the -I switch... thanks!
    • YAMAGATA yoriyuki
      From: bwv211mail Subject: ocaml_beginners ::[] ocaml libraries and using your own Date: Tue, 02 Jul 2002 21:48:55 -0000 ... As far as
      Message 2 of 2 , Jul 3, 2002
      • 0 Attachment
        From: "bwv211mail" <bwv211mail@...>
        Subject: "ocaml_beginners"::[] ocaml libraries and using your own
        Date: Tue, 02 Jul 2002 21:48:55 -0000

        > I would like to have my own "local standard"
        > libraries that are automagically searched for, but I can't find a
        > way to do it - I always have to end up specifying "mylib.cma" or
        > "mylib.cmxa" on the command line... it finds the .cmi files all
        > right without anything but the -I switch...

        As far as I know, there is no way to do so. I guess the reason is
        that libraries can have side effects. So, the linker (you need to
        specify "mylib.cma" only for a linking phase, not compilation.) has to
        know in what order libraries should be loaded. Correct me if I said
        something wrong.

        For the toplevel (interactive evaluation), you can create the toplevel
        with preloaded "mylib.cma" as

        $ ocamlmktop -o mytoplevel mylib.cma

        See section 9.5 in the manual.
        --
        Yamagata Yoriyuki
        http://www.mars.sphere.ne.jp/yoriyuki/
      Your message has been successfully submitted and would be delivered to recipients shortly.