The show directive now has some basic facility to show
useful information for constructors of "normal" values,
exceptions and other non-exception extension constructors.
Also updated show_type to print out recursion status
with a default of Trec_first.
There is a small change of behavior in this patch due to a different
handling of weak dependencies (those with crco=None); in
Env.check_consistency, only non-weak dependencies would get
[Env.add_import] called, while the `toplevel/` implementations would
also call [Env.add_import] on weak dependencies. After this patch, we
systematically call [add_import] only on non-weak dependencies, even
in `toplevel/`.
([Gabriel:] As far as I can see, the use of [add_import] in the
toplevel never leads to a use of [Env.imports()] for producing
a dependency list, as the toplevel does not produce cmi/cmo files; are
they just no-ops?)
- Add a Load_path module which caches files lookup
- Instead of falling back to the external environment, allow to
declare in the environment that a module comes from the external
world. This allows persistent structures to shadows non-persistent
ones
- Ident.create now takes a scope as argument
- added Ident.create_var to use when the scope doesn't matter
- the current_time and the current_level are unrelated as of this
commit. But one has to remember to bump the level when creating new
scopes.
The bytecode runtime now represents code to be loaded as LongString.t,
rather than as a naked pointer to a bytecode block.
(This commit breaks Dynlink of bytecode, due to an issue about digests)
The toplevel output for #help seems to be sorted and looks like:
#show <ident>
Print the signatures of components from any of the above categories.
#show_class <ident>
Print the signature of the corresponding class.
#show_class_type <ident>
[...]
Thus the documentation for #show needs to say that the categories are
below, not above. The code is effectful and has the specific #show_*
directives before the general #show one. That's why I expect there is
some kind of sorting done at runtime.
Before this patch,
module A = struct let x = 1 end;;
module B = struct module M = A end;;
module C = B.M;;
module D = C;;
#show D;;
would print
module D = C
now it prints
module D = C
module D = B.M
module D = A
module D : sig val x : int end
Note that one might expect to read
module D = C
module C = ...
instead, but this would result in the next line being
module B.M = ...
which is not syntactically correct.
Note that this approach could be generalized to other forms of
aliases-following, types in particular.
(Peter Zotov and Jake Donham,
review by Gabriel Scherer and Jacques-Henri Jourdan)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15830 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02