用于ocamlfind list
获取所有已知 ocamlfind 包的列表,以及它们的内部名称。
如果您在顶层 ( ocaml
) 中激活了 findlib,那么您将获得有关将包加载到顶层的提示:
str@s132-intel:~> ocaml
OCaml version 4.02.3
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable
要在顶层使用包,请#require "internalname";;
使用 显示的名称#list;;
,然后才能使用 open。
旁注:open Modulename
缺点是隐藏功能的来源。
要编译您的代码,可以调用以 ocamlfind 为前缀的编译器,请参阅此处的 ocamlfind 文档,一般语法为:
# binary test1, use modules Unix and Str, link packages in
ocamlfind ocamlc -o test1 -packages unix,str -linkpkg test1.ml
希望这能让你开始。有关更多信息,请参见 ocaml.org。
请耐心等待,这不是具有大量材料的主流语言。但是您可以直接在他们的邮件列表上与研究人员和开发人员交谈。