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

Loading libraries

Expand Messages
  • cugf_0956
    I want to use unix module and the only way I can do that is to use ocaml unix.cma - when starting interpreter. I would like to load this module automatically,
    Message 1 of 3 , Aug 3, 2007
    • 0 Attachment
      I want to use unix module and the only way I can do that is to use
      ocaml unix.cma - when starting interpreter.
      I would like to load this module automatically, how can I do that?
      Just specifying directory is not an option as cma files are not stored
      all in one directory.
      Also, I tried to call load "unix.cma" from the ocaml shell
      but ocaml complaint that load is undefined. Why?
      I tried using unix.cma in .ocamlint and got "undefined unix" error.

      The best way as I see it is to put all libraries I want to use into
      .ocamlint file. Could you help me please.

      Thanks,
    • Christophe TROESTLER
      ... Put in a file named ~/.ocamlinit : #load unix.cma ;; ChriS
      Message 2 of 3 , Aug 3, 2007
      • 0 Attachment
        On Fri, 03 Aug 2007 22:45:39 -0000, cugf_0956 wrote:
        >
        > I want to use unix module and the only way I can do that is to use
        > ocaml unix.cma - when starting interpreter.
        > I would like to load this module automatically, how can I do that?

        Put in a file named ~/.ocamlinit :

        #load "unix.cma";;

        ChriS
      • jshaw10
        load isn t a caml function, rather it s a toplevel command. Toplevel commands are prefixed by #. #load unix.cma ;; Additionally, depending on your platform
        Message 3 of 3 , Aug 3, 2007
        • 0 Attachment
          load isn't a caml function, rather it's a toplevel command. Toplevel
          commands are prefixed by #.

          #load "unix.cma";;



          Additionally, depending on your platform you might be able to create
          custom toplevels with preloaded libraries.

          ocamlmktop -o ocamlunix unix.cma
        Your message has been successfully submitted and would be delivered to recipients shortly.