Blame browser/README

Packit bd2e5d
Packit bd2e5d
                   Installing and Using OCamlBrowser
Packit bd2e5d
Packit bd2e5d
Packit bd2e5d
INSTALLATION
Packit bd2e5d
   If you installed it with LablTk, nothing to do.
Packit bd2e5d
   Otherwise, the source is in labltk/browser.
Packit bd2e5d
   After installing LablTk, simply do "make" and "make install".
Packit bd2e5d
   The name of the command is `ocamlbrowser'.
Packit bd2e5d
Packit bd2e5d
USE
Packit bd2e5d
   OCamlBrowser is composed of three tools, the Viewer, to walk around
Packit bd2e5d
   compiled modules, the Editor, which allows one to
Packit bd2e5d
   edit/typecheck/analyse .mli and .ml files, and the Shell, to run an
Packit bd2e5d
   OCaml subshell. You may only have one instance of Editor and
Packit bd2e5d
   Viewer, but 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 CAMLLIB. You may also extend the
Packit bd2e5d
   initial load path (only standard library by default) by using the
Packit bd2e5d
   -I command line option, or set various other options (see -help).
Packit bd2e5d
Packit bd2e5d
   If you prefered the old GUI, it is still available with the option
Packit bd2e5d
   -oldui, otherwise you get a new Smalltalkish user interface.
Packit bd2e5d
Packit bd2e5d
1) Viewer
Packit bd2e5d
Packit bd2e5d
 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 all the interface of the currently
Packit bd2e5d
        selected module
Packit bd2e5d
   View - Search entry  shows/hides the search entry at the top of the
Packit bd2e5d
        window
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
   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
Packit bd2e5d
        interestingly, by its type. Exact type searches for a type
Packit bd2e5d
        with exactly the same information as the pattern (variables
Packit bd2e5d
        match only variables), included type allows to give only
Packit bd2e5d
        partial information: the actual type may take more arguments
Packit bd2e5d
        and return more results, and variables in the pattern match
Packit bd2e5d
        anything. In both cases, argument and tuple order is
Packit bd2e5d
        irrelevant (*), and unlabeled arguments in the pattern match
Packit bd2e5d
        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
 Search entry
Packit bd2e5d
Packit bd2e5d
   The entry line at the top allows one to search for an identifier
Packit bd2e5d
   in all modules, either by its name (? and * patterns allowed) or by
Packit bd2e5d
   its type. When search by type is used, it is done in inclusion mode
Packit bd2e5d
   (cf. Modules - search symbol)
Packit bd2e5d
Packit bd2e5d
   The Close all button at the bottom is there to dismiss the windows
Packit bd2e5d
   created by the Detach button. By double-clicking on it you will
Packit bd2e5d
   quit the browser.
Packit bd2e5d
Packit bd2e5d
 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
Packit bd2e5d
   name. Double-clicking / double-return displays the whole signature
Packit bd2e5d
   for 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
   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. You can discard these windows with Close all.
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
2) Editor
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
3) Shell
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
* This not really a bug, but OCamlBrowser is a huge memory consumer.
Packit bd2e5d
  Go and buy some.
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 an
Packit bd2e5d
  experimented users.
Packit bd2e5d
Packit bd2e5d
Packit bd2e5d
Bug reports and comments to <garrigue@kurims.kyoto-u.ac.jp>