26

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..

jrouquie
  • 4,315
  • 4
  • 27
  • 43
int3
  • 12,861
  • 8
  • 51
  • 80

4 Answers4

21

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

Mikael S
  • 5,206
  • 2
  • 23
  • 21
  • How do I use rlwrap to get command history when I'm in the OCaml interpreter? – Arthur Collé Mar 13 '14 at 22:31
  • I'm that Arthur Collé has found the answer by now, but for someone else who happens to be looking for the same answer in the future, one would run ocaml like this from shell prompt: `rlwrap ocaml`. – Mars Apr 24 '17 at 05:03
21

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

9

Use ledit ocaml with ledit.

J D
  • 48,105
  • 13
  • 171
  • 274
6

You can also use the online toplevel.

Çağdaş Bozman
  • 2,537
  • 16
  • 21