我刚刚安装了BER MetaOCaml,其中包括:
$ opam update $ opam switch 4.02.1+BER $ eval `opam config env`
而且我无法在tuareg toplevel中运行MetaOCaml代码或只是ocaml toplevel.以下代码:
let a = .<1+2>.;;
结果是
Error: Reference to undefined global `Trx'
我试过#load "trx.cma"
但它找不到文件.
答案编辑:
metaocaml是正确的可执行文件.
添加后:
`(defun tuareg-run-metaocaml () "Run an OCaml toplevel process. I/O via buffer `*ocaml-toplevel*'." (interactive) (tuareg-run-process-if-needed "/usr/bin/opam config exec -- metaocaml") (display-buffer tuareg-interactive-buffer-name)) (add-hook 'tuareg-mode-hook ' (lambda () (define-key tuareg-mode-map (kbd "C-c M-s") 'tuareg-run-metaocaml)))`
对于我的.emacs,我现在可以运行MetaOCaml了C-c M-s
.