1

我正在使用需要camlp5的 OCaml 代码;但是,顶层(我使用的是utop)会自动加载更新的、不兼容的camlp4。这些是启动消息:

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 threads

即时通讯使用.ocamlinit看起来像这样:

#use "topfind";;
#thread;;

我安装camlp5opam它,它在我发出时出现ocamlfind list;该文件camlp5.cma也位于/home/<username>/.opam/4.02.1/lib/camlp5/camlp5.cma. 但是尝试加载camlp5ocamlp5r失败Unknown directive camlp5o

我如何utop知道camlp5以及如何替换camlp4camlp5默认预处理器?

提前谢谢了!

4

1 回答 1

4
$ ocaml
    OCaml version 4.02.1

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 threads

# #require "camlp5";;
/home/kakadu/.opam/4.02.1/lib/camlp5: added to search path
# #load "camlp5o.cma";;
    Camlp5 parsing version 6.12

# 
于 2015-05-25T16:55:01.127 回答