在 utop 中用 camlp5 替换 camlp4
replace camlp4 with camlp5 in utop
我正在使用需要 camlp5; however, the toplevel (I'm using utop) 自动加载更新的、不兼容的 camlp4 的 OCaml 代码。这些是启动消息:
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;;
我用 opam
安装了 camlp5
,它在我发出 ocamlfind list
时显示;文件 camlp5.cma
也位于 /home/<username>/.opam/4.02.1/lib/camlp5/camlp5.cma
。
但是尝试加载 camlp5o
和 camlp5r
失败并显示 Unknown directive camlp5o
.
如何让 utop
知道 camlp5
以及如何将 camlp4
替换为 camlp5
作为默认预处理器?
非常感谢!
$ 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
#
我正在使用需要 camlp5; however, the toplevel (I'm using utop) 自动加载更新的、不兼容的 camlp4 的 OCaml 代码。这些是启动消息:
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;;
我用 opam
安装了 camlp5
,它在我发出 ocamlfind list
时显示;文件 camlp5.cma
也位于 /home/<username>/.opam/4.02.1/lib/camlp5/camlp5.cma
。
但是尝试加载 camlp5o
和 camlp5r
失败并显示 Unknown directive camlp5o
.
如何让 utop
知道 camlp5
以及如何将 camlp4
替换为 camlp5
作为默认预处理器?
非常感谢!
$ 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
#