Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an enhanced interpreter toploop for OCaml? [closed]

Tags:

ocaml

ledit

Python has IPython.. does OCaml have anything similar?

I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs..

like image 877
int3 Avatar asked Dec 04 '09 19:12

int3


People also ask

What is top level OCaml?

In short, the toplevel is OCaml's Read-Eval-Print-Loop (repl) allowing interative use of the OCaml system. You can consider the toplevel an alternative to compiling OCaml into an executable.

How do you use Utop?

In a terminal window, type utop to start the interactive OCaml session, commonly called the toplevel. Press Control-D to exit the toplevel. You can also enter #quit;; and press return. Note that you must type the # there: it is in addition to the # prompt you already see.


2 Answers

rlwrap gives you readline features (history, editing commands, etc). Also, Findlib adds some functionality, see the quickstart for examples.

like image 151
Mikael S Avatar answered Oct 19 '22 03:10

Mikael S


There's utop! It has autocompletion, is emacs compatible and so on.

like image 39
Philipp Siegmantel Avatar answered Oct 19 '22 04:10

Philipp Siegmantel