Can ocaml REPL support autocomplete, etc.?

Are there other ways to do ocaml auto-tuning, etc., except using rlwrap?

Yours faithfully!

+7
source share
2 answers

Until recently, a system called utop was announced on the OCaml mailing list. This is a top-level replacement for OCaml with many advanced features. It seems to be posted on OcamlCore.org:

http://forge.ocamlcore.org/projects/utop/

I have not tried it, but it sounds great.

I use rlwrap myself.

+11
source

You can use ocaml toplevel from within the Emacs buffer, which receives solid rlwrap -like editing functions, plus everything you have in your Emacs configuration, including potential shutdown modes other than ocaml.

In addition to Jérémie Dimino utop , which Jeffrey has already quoted, there are other, older projects regarding OCaml toplevel. They do not all provide completion, but you may still be interested in them:

  • Zheng Li Enhtop ( README ), which provides directives for viewing the current top-level environment.
  • Peng Zang Enhtop + , an incremental patch over Enhtop that comes with tuareg-plus , providing additional tuareg features, including ocaml-aware completion, which are also available from the Emacs toplevel buffer

(Connected, but not toplevel-oriented, this is Jun Furuse Ocamlspotter , which allows you to get the exact value of where-was-this-name- specific information for OCaml files in Emacs)

All of these projects are patches for OCaml sources. This means that to install them you must download the OCaml compiler sources, fix them, compile and use the result as an OCaml installation (it is possible that the existing OCaml installation, fix and compile the same version, the compiler separately and selectively use / replace interesting executables files). It also means that patch development has a maintenance need that should follow OCaml compiler updates and that you can limit the use of OCaml versions. In short, they are easy to deploy.

+7
source

All Articles