SublimeREPL
SublimeREPL copied to clipboard
OCaml UTOP REPL doesn't work
When trying to use OCaml utop
, I receive the following:
Welcome to utop version 1.17 (using 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
***Repl Closed***
Running utop
from a terminal or emacs works as expected. Any idea of what could be wrong?
i just get ***Repl Closed***
:/
@ilch1 @nolefp My workaround:
- Find and open the
~/Library/Application Support/Sublime Text 3/Packages/SublimeREPL/config/OCaml/Main.sublime-menu
. - Locate the
extend_env
field in theutop
section. The default looks like:
"extend_env": {
"OCAML_TOPLEVEL_PATH": "{HOME}/.opam/system/lib/stublibs:/usr/lib/ocaml/stublibs",
"CAML_LD_LIBRARY_PATH": "{HOME}/.opam/system/lib/toplevel",
"PATH": "{PATH}:{HOME}/.opam/system/bin"
},
- Look up
OCAML_TOPLEVEL_PATH
andCAML_LD_LIBRARY_PATH
by running the commandopam config env
in your shell. - Fill in the two fields with what the
opam config env
tells you. Then it looks like:
"extend_env": {
"OCAML_TOPLEVEL_PATH": "/Users/<yourname>/.opam/4.04.2/lib/toplevel",
"CAML_LD_LIBRARY_PATH": "/Users/<yourname>/.opam/4.04.2/lib/stublibs",
"PATH": "{PATH}:{HOME}/.opam/system/bin"
},
- After that I get a working
utop
repl in Sublime.
Disclaimer: I'm new to OCaml and Sublime. There should be a better way to fix this issue. I hope the workaround works for you and that you still have faith in OCaml and Sublime. :P