1999-11-30 06:59:39 -08:00
|
|
|
|
2000-01-07 08:05:19 -08:00
|
|
|
Installing and Using OCamlBrowser
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
|
|
|
|
INSTALLATION
|
|
|
|
If you installed it with LablTk, nothing to do.
|
1999-12-10 07:50:53 -08:00
|
|
|
Otherwise, the source is in labltk/browser.
|
1999-11-30 06:59:39 -08:00
|
|
|
After installing LablTk, simply do "make" and "make install".
|
1999-12-10 07:50:53 -08:00
|
|
|
The name of the command is `ocamlbrowser'.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
USE
|
2001-09-27 00:31:55 -07:00
|
|
|
OCamlBrowser is composed of three tools, the Viewer, to walk around
|
|
|
|
compiled modules, the Editor, which allows one to
|
|
|
|
edit/typecheck/analyse .mli and .ml files, and the Shell, to run an
|
|
|
|
OCaml subshell. You may only have one instance of Editor and
|
|
|
|
Viewer, but you may use several subshells.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
As with the compiler, you may specify a different path for the
|
2001-09-27 00:31:55 -07:00
|
|
|
standard library by setting CAMLLIB. You may also extend the
|
1999-11-30 06:59:39 -08:00
|
|
|
initial load path (only standard library by default) by using the
|
2001-09-27 00:31:55 -07:00
|
|
|
-I command line option, or set various other options (see -help).
|
1999-11-30 06:59:39 -08:00
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
If you prefered the old GUI, it is still available with the option
|
|
|
|
-oldui, otherwise you get a new Smalltalkish user interface.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
1) Viewer
|
1999-11-30 06:59:39 -08:00
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
Menus
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
File - Open and File - Editor give access to the editor.
|
|
|
|
|
1999-12-10 07:50:53 -08:00
|
|
|
File - Shell opens an OCaml shell.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
View - Show all defs displays all the interface of the currently
|
|
|
|
selected module
|
|
|
|
View - Search entry shows/hides the search entry at the top of the
|
|
|
|
window
|
|
|
|
|
1999-11-30 06:59:39 -08:00
|
|
|
Modules - Path editor changes the load path.
|
2000-01-07 08:05:19 -08:00
|
|
|
Pressing [Add to path] or Insert key adds selected directories
|
|
|
|
to the load path.
|
|
|
|
Pressing [Remove from path] or Delete key removes selected
|
|
|
|
paths from the load path.
|
1999-11-30 06:59:39 -08:00
|
|
|
Modules - Reset cache rescans the load path and resets the module
|
2001-09-27 00:31:55 -07:00
|
|
|
cache. Do it if you recompile some interface, or change the load
|
|
|
|
path in a conflictual way.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
Modules - Search symbol allows to search a symbol either by its
|
2001-09-27 00:31:55 -07:00
|
|
|
name, like the bottom line of the viewer, or, more
|
|
|
|
interestingly, by its type. Exact type searches for a type
|
|
|
|
with exactly the same information as the pattern (variables
|
|
|
|
match only variables), included type allows to give only
|
|
|
|
partial information: the actual type may take more arguments
|
|
|
|
and return more results, and variables in the pattern match
|
|
|
|
anything. In both cases, argument and tuple order is
|
|
|
|
irrelevant (*), and unlabeled arguments in the pattern match
|
|
|
|
any label.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
(*) To avoid combinatorial explosion of the search space, optional
|
|
|
|
arguments in the actual type are ignored if (1) there are to many
|
|
|
|
of them, and (2) they do not appear explicitly in the pattern.
|
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
Search entry
|
|
|
|
|
|
|
|
The entry line at the top allows one to search for an identifier
|
|
|
|
in all modules, either by its name (? and * patterns allowed) or by
|
|
|
|
its type. When search by type is used, it is done in inclusion mode
|
|
|
|
(cf. Modules - search symbol)
|
|
|
|
|
|
|
|
The Close all button at the bottom is there to dismiss the windows
|
|
|
|
created by the Detach button. By double-clicking on it you will
|
|
|
|
quit the browser.
|
|
|
|
|
|
|
|
Module browsing
|
|
|
|
|
|
|
|
You select a module in the leftmost box by either cliking on it or
|
|
|
|
pressing return when it is selected. Fast access is available in
|
|
|
|
all boxes pressing the first few letter of the desired
|
|
|
|
name. Double-clicking / double-return displays the whole signature
|
|
|
|
for the module.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
2001-09-27 00:31:55 -07:00
|
|
|
Defined identifiers inside the module are displayed in a box to the
|
|
|
|
right of the previous one. If you click on one, this will either
|
|
|
|
display its contents in another box (if this is a sub-module) or
|
|
|
|
display the signature for this identifier below.
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
Signatures are clickable. Double clicking with the left mouse
|
2001-09-27 00:31:55 -07:00
|
|
|
button on an identifier in a signature brings you to its signature.
|
1999-11-30 06:59:39 -08:00
|
|
|
A single click on the right button pops up a menu displaying the
|
|
|
|
type declaration for the selected identifier. Its title, when
|
|
|
|
selectable, also brings you to its signature.
|
|
|
|
|
|
|
|
At the bottom, a series of buttons, depending on the context.
|
|
|
|
* Detach copies the currently displayed signature in a new window,
|
2001-09-27 00:31:55 -07:00
|
|
|
to keep it. You can discard these windows with Close all.
|
1999-11-30 06:59:39 -08:00
|
|
|
* Impl and Intf bring you to the implementation or interface of
|
|
|
|
the currently displayed signature, if it is available.
|
|
|
|
|
|
|
|
C-s opens a text search dialog for the displayed signature.
|
2000-01-07 08:05:19 -08:00
|
|
|
|
2001-09-27 01:24:50 -07:00
|
|
|
2) Editor
|
1999-11-30 06:59:39 -08:00
|
|
|
You can edit files with it, but there is no auto-save nor undo at
|
|
|
|
the moment. Otherwise you can use it as a browser, making
|
|
|
|
occasional corrections.
|
|
|
|
|
|
|
|
The Edit menu contains commands for jump (C-g), search (C-s), and
|
|
|
|
sending the current selection to a sub-shell (M-x). For this last
|
|
|
|
option, you may choose the shell via a dialog.
|
|
|
|
|
|
|
|
Essential function are in the Compiler menu.
|
|
|
|
|
|
|
|
Preferences opens a dialog to set internals of the editor and
|
|
|
|
type checker.
|
|
|
|
|
|
|
|
Lex (M-l) adds colors according to lexical categories.
|
|
|
|
|
|
|
|
Typecheck (M-t) verifies typing, and memorizes it to let one see an
|
|
|
|
expression's type by double-clicking on it. This is also valid for
|
|
|
|
interfaces. If an error occurs, the part of the interface preceding
|
|
|
|
the error is computed.
|
|
|
|
|
|
|
|
After typechecking, pressing the right button pops up a menu giving
|
|
|
|
the type of the pointed expression, and eventually allowing to
|
|
|
|
follow some links.
|
|
|
|
|
|
|
|
Clear errors dismisses type checker error messages and warnings.
|
|
|
|
|
|
|
|
Signature shows the signature of the current file.
|
|
|
|
|
2001-09-27 01:24:50 -07:00
|
|
|
3) Shell
|
1999-11-30 06:59:39 -08:00
|
|
|
When you create a shell, a dialog is presented to you, letting you
|
|
|
|
choose which command you want to run, and the title of the shell
|
|
|
|
(to choose it in the Editor).
|
|
|
|
|
|
|
|
You may change the default command by setting the OLABL environment
|
|
|
|
variable.
|
|
|
|
|
|
|
|
The executed subshell is given the current load path.
|
|
|
|
File: use a source file or load a bytecode file.
|
|
|
|
You may also import the browser's path into the subprocess.
|
|
|
|
History: M-p and M-n browse up and down.
|
|
|
|
Signal: C-c interrupts and you can kill the subprocess.
|
|
|
|
|
|
|
|
BUGS
|
|
|
|
|
1999-12-10 07:50:53 -08:00
|
|
|
* This not really a bug, but OCamlBrowser is a huge memory consumer.
|
1999-11-30 06:59:39 -08:00
|
|
|
Go and buy some.
|
|
|
|
|
|
|
|
* When you quit the editor and some file was modified, a dialogue is
|
|
|
|
displayed asking wether you want to really quit or not. But 1) if
|
|
|
|
you quit directly from the viewer, there is no dialogue at all, and
|
2000-01-07 08:05:19 -08:00
|
|
|
2) if you close from the window manager, the dialogue is displayed,
|
1999-11-30 06:59:39 -08:00
|
|
|
but you cannot cancel the destruction... Beware.
|
|
|
|
|
2000-01-07 08:05:19 -08:00
|
|
|
* When you run it through xon, the shell hangs at the first error. But
|
1999-12-10 07:50:53 -08:00
|
|
|
its ok if you start ocamlbrowser from a remote shell...
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
|
|
* Complete cross-references.
|
|
|
|
|
|
|
|
* Power up editor.
|
|
|
|
|
|
|
|
* Add support for the debugger.
|
|
|
|
|
|
|
|
* Make this a real programming environment, both for beginners an
|
|
|
|
experimented users.
|
|
|
|
|
|
|
|
|
2000-01-07 08:05:19 -08:00
|
|
|
Bug reports and comments to <garrigue@kurims.kyoto-u.ac.jp>
|