dune icon indicating copy to clipboard operation
dune copied to clipboard

allow to use rtop (reasonml utop) with dune

Open MohamedLEGH opened this issue 2 years ago • 1 comments

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.

MohamedLEGH avatar Jul 15 '22 17:07 MohamedLEGH

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 into refmt --parse=ml would work, but refmt 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.

emillon avatar Jul 22 '22 12:07 emillon