dune
dune copied to clipboard
allow to use rtop (reasonml utop) with dune
Desired Behavior
dune allow to compile reasonml files but AFAIK we cannot use the rtop REPL.
Example
just run dune rtop
and you will get inside the ReasonML REPL, the same way as dune utop
for Ocaml projects.
I had a look at this. A simple way to do this without a new command is to call #use_output "dune top"
in rtop
. However there are 2 problems with this:
-
dune top
outputs;;
at the end of lines. I thought that piping intorefmt --parse=ml
would work, butrefmt
throws a syntax error. I suppose it can not handle#
-directives. `#use_output "dune top | sed 's/;;$/;/'" should work. - it seems that
#use_output
is broken in utop. For example,#use_output "cat file.txt"
hangs.
Assuming both are fixed I think that it would work. This could then be defined as an alias in rtop
.