dbuenzli / down

An OCaml toplevel (REPL) upgrade

Home Page:http://erratique.ch/software/down

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Cannot find file down" from ocaml and utop

joprice opened this issue · comments

I can't seem to load down from dune's utop command or the ocaml toplevel. I'm using nix so perhaps dependencies for the toplevel are not where they're expected to be. I could probably symlink them elsewhere if I have to, but I'm not sure where toplevels search for their dependencies.

Here again I can't help you if you don't provide more details (context, exact sequence of steps you are performing and resulting errors). In any case down is not made to be used by or in utop.

I wasn't sure what to provide as there's many components (ocaml, dune, nix, etc) so I started with the general question. I was able to make a little progress by removing the following calls from ~/.ocamlinit

let () =
    try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
    with Not_found -> ()
  ;;

and using #require "down";; instead of #use "down.top";;

Not sure about the difference but this seems to work for me at least to try out down.

I wasn't sure what to provide as there's many components (ocaml, dune, nix, etc) so I started with the general question

I general showing basic steps inputs/install commands, verbatim error messages and providing context (versions, stetup) is necessary to be of any help.

In that particular case it seems that the OCAML_TOPLEVEL_PATH is not setup so that it finds where down.top is installed.

You are now loading down with ocamlfind (require is an ocamlfind directive) which should be fine. But down is designed so that you can load it even if you don't have ocamlfind installed, by #useing down.top