Description
currently, when working with an OCaml project involving a large number of dependencies, it is difficult to perform tests in a REPL (C-c C-s) with the proper packages loaded.
Granted, one can manually evaluate #load "topfind";;
then #require "jwto";;
or so for each package, but it quickly becomes cumbersome on realistic projects.
Would it be possible to implement an elisp feature that would pre-compute the list of packages (e.g. from the PKG
lines involved in a .merlin
file) and propose to run a command like this when doing C-c C-s?
OCaml REPL to run: OCAMLFIND_COMMANDS='ocamlc=ocaml' ocamlfind ocamlc -linkpkg -package jwto
Note: this can be tested in a terminal by running:
$ opam install jwto
$ packages="jwto"
$ OCAMLFIND_COMMANDS='ocamlc=ocaml' ocamlfind ocamlc -linkpkg $(for arg in $packages; do echo "-package $arg"; done)
OCaml version 4.05.0
#show Jwto;;
What do you think?
Maybe this idea should be further refined, but AFAICT one such feature would be really great!
Cc @Chris00 @monnier @cpitclaudel @Aleridia FYI