Open Maelan opened 6 years ago
This is probably caused by toplevel expunging.
How to fix it? Using utop-full
instead of utop
does not appear to change anything.
@Maelan when you build a toplevel, by default all the modules that are linked in this toplevel are visible and accessible to code evaluated inside this toplevel. This can be an issue because:
Path
, Ident
, ...For instance, this means that you cannot load a library with a toplevel module called Path
inside the toplevel. To workaround this issue, there is an expunge
step that hides all these modules. They are still linked in, but they cannot be accessed from code evaluated inside the toplevel.
To check whether the issue you are seeing is related to expunging, you can try to reproduce it with utop-full
, which is non-expunged version of utop.
Perhaps some documentation improvements would be in order here.
Any news on this issue? It is still there as of utop 2.13.1 and ocamlfind 1.9.6.
@Maelan What would you see as an appropriate resolution?
Sorry I don’t know, because I don’t know the internals of utop, and because I didn’t get how the reported behavior was related to module expunging as mentioned in previous messages. Using utop-full
instead of utop
did not make a difference. The only thing I can tell is that the currently observed behavior (Topfind printing its welcome message regardless of Sys.interactive
) looks like a bug and that, unless utop devs say it is a feature, it should instead exhibit the same behavior as the vanilla ocaml
toplevel (printing the welcome message is conditioned upon the value of Sys.interactive
).
In
utop
, by contrast withocaml
, Topfind apparently ignores the value ofSys.interactive
and prints its greeting message anyway.Tested with OCaml 4.07.0, ocamlfind 1.8.0, utop 2.2.0.
In
ocaml
, Topfind apparently honoursSys.interactive
when it is first loaded (however, when loaded again, as can be seen in the output below, it repeats the same behaviour even ifSys.interactive
has since changed; not sure if it is a bug, nor if it is related to this issue).In
utop
, Topfind always prints its greeting message.This is especially annoying when chaining several init scripts, which all load topfind because they need it and cannot assume it has been done by someone else.