Run MetaOCaml Code

I just installed BER MetaOCaml with the following:

$ opam update $ opam switch 4.02.1+BER $ eval `opam config env` 

and I cannot run MetaOCaml code in tuareg toplevel or just ocaml toplevel. The following code:

 let a = .<1+2>.;; 

leads to

 Error: Reference to undefined global `Trx' 

I tried #load "trx.cma" but could not find the file.

Edit Answer:

metaocaml is the correct executable file.

After adding:

 `(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 "Cc Ms") 'tuareg-run-metaocaml)))` 

In my .emacs, I can now start MetaOCaml using Cc Ms

+5
source share

Source: https://habr.com/ru/post/1240170/


All Articles