|Anonymous | Login | Signup for a new account||2013-05-25 19:11 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005377||OCaml||OCaml general||public||2011-10-17 16:16||2011-12-16 07:01|
|Target Version||Fixed in Version||3.13.0+dev|
|Summary||0005377: toplevel should provide an option to limit recursion when printing nested modules|
|Description||This would make exploring libraries from toplevel much easier. For each package one can get the list of modules (with findlib), but the only way to explore modules is to include them (or alias) - and for big libraries this can produce lots and lots of output, while one usually wants to see only the first level and explore deeper as needed. This should probably be a directive similar to #print_depth|
# #use "topfind";;
- : unit = ()
# #require "camomile";;
/usr/local/lib/ocaml/3.11.2/camomile: added to search path
# include CamomileLibraryDefault;;
[0001276:0001000 lines of output]
|Tags||No tags attached.|
|Attached Files||show_types2.diff [^] (9,461 bytes) 2011-12-15 11:29 [Show Content]|
You were lucky: I have reports of messages of more than 1MB...
This is now fixed in trunk: long traces are omitted, replaced by logical and physical locations for the error. (commits 11225-11230)
edited on: 2011-10-24 12:05
The patch affects printing of error locations, but I am talking here about toplevel's normal way to display the contents of module.
Sorry, if I am mistaken - current trunk doesn't build - http://build.ygrek.org.ua/jenkins/job/ocaml/label=master/66/console [^] - so I can't verify it.
OK, it seems that I misunderstood what you wanted.
Indeed, there is no support for exploring modules in the toplevel,
other than printing the full signature by aliasing a module.
However, a pragma for changing the logical print depth of
modules seems a rather hacky way to go; one would rather
use a real cli library browser...
This might be nice if we can find a minimal language to do that.
#show value <path>
#show type <path>
#show module <path> [<depth>]
#show module type <path> [<depth>]
#search value "<regexp>"
Note that there are also GUI tools to do that, like ocamlbrowser
(which works with just .cmi), or ocamldoc.
By the way, at least for me trunk compiles perfectly.
But don't forget 'make clean' before you start.
I definitely like the #show pragma :)
Exploring with external tools is fine, but an ability to do this directly from toplevel, in ad-hoc manner, is invaluable.
PS I did check the build failure with clean svn checkout
A simple patch is now available in trunk/experimental/garrigue/show_types.diffs
It defines directives
There is no depth option at this point (they all only take a path).
Concerning the depth, printing uses the standard formatter, so you can just do
Format.set_max_boxes 6 to get only in the immediate contents of a module.
Here is an updated patch that sticks to single #show directive.
Thanks for the trick with Format - it helps, but is not a proper solution - e.g. it works for CamomileLibrary (this module consists of only other modules) but not for say CamomileLibrary.UChar (types are not displayed).
|2011-10-17 16:16||ygrek||New Issue|
|2011-10-24 01:06||garrigue||Note Added: 0006176|
|2011-10-24 01:06||garrigue||Status||new => resolved|
|2011-10-24 01:06||garrigue||Fixed in Version||=> 3.13.0+dev|
|2011-10-24 01:06||garrigue||Resolution||open => fixed|
|2011-10-24 01:06||garrigue||Assigned To||=> garrigue|
|2011-10-24 12:04||ygrek||Note Added: 0006178|
|2011-10-24 12:04||ygrek||Status||resolved => feedback|
|2011-10-24 12:04||ygrek||Resolution||fixed => reopened|
|2011-10-24 12:05||ygrek||Note Edited: 0006178|
|2011-10-25 03:42||garrigue||Note Added: 0006180|
|2011-10-25 09:40||ygrek||Note Added: 0006182|
|2011-12-15 09:17||garrigue||Note Added: 0006300|
|2011-12-15 09:17||garrigue||Status||feedback => acknowledged|
|2011-12-15 09:22||garrigue||Note Added: 0006301|
|2011-12-15 11:27||ygrek||Note Added: 0006310|
|2011-12-15 11:29||ygrek||File Added: show_types2.diff|
|2011-12-16 07:01||garrigue||Relationship added||related to 0005430|
|Copyright © 2000 - 2011 MantisBT Group|