Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to use rtop (reasonml utop) with dune #5975

Open
MohamedLEGH opened this issue Jul 15, 2022 · 1 comment
Open

allow to use rtop (reasonml utop) with dune #5975

MohamedLEGH opened this issue Jul 15, 2022 · 1 comment

Comments

@MohamedLEGH
Copy link

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.

@emillon
Copy link
Collaborator

emillon commented Jul 22, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants