Open SleepyMug opened 11 months ago
I second this : using merlin in Emacs+Tuareg is a thing, and this fails if there is a directive.
Note however that many directives can be replaced by their definition from https://github.com/ocaml/ocaml/blob/trunk/toplevel/topdirs.ml.
For instance, #use "thing"
seems to be replaceable with Topdirs.dir_use Format.std_formatter "thing"
.
In fact this is even better because you can use OCaml expressions, including variables, to build the file name : I am a fan of Topdirs.dir_directory ("/path-to-precompiled-files/ ^ Sys.ocaml_version)
, which lets me put *.cmo
files for different OCaml versions in their respectives directories.
I tried to write an Ocaml program in a scripting style, but I realized merlin (version 4.12-501) does not work with toplevel directives. The simplest example would be
The program I was trying to do looks like this
I'm new to the language, and I have the feeling that this isn't how serious ocaml projects are designed to be run. But it's still useful for simple scripts and test out things.
The problem is similar to #1023 .