Blame browser/help.txt

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