alice
library
manual.

Alice Project

The Inspector structure


________ Synopsis ____________________________________________________

    signature INSPECTOR
    structure Inspector : INSPECTOR

The Inspector is a tool that allows to interactively display and inspect data structures.

For example, the expression

inspect x

tells the Inspector to show the value x. The Inspector will popup a window and pretty-print the value. Different elements can be assigned different colors to make output more readable.


________ Import ______________________________________________________

    import structure Inspector from "x-alice:/lib/tools/Inspector"
    import signature INSPECTOR from "x-alice:/lib/tools/INSPECTOR-sig"

In the interactive toplevel the Inspector is available without further import announcements. The function inspect is available unqualified.


________ Interface ___________________________________________________

    signature INSPECTOR =
    sig
	type value

	datatype color =
	    KEEP_COLOR
	  | SET_COLOR       of {red : int, green : int, blue : int}
	datatype width =
	    KEEP_WIDTHS
	  | REPLACE_WIDTHS  of int vector
	  | APPEND_WIDTH    of int
	  | REMOVE_WIDTH    of int
	datatype depth =
	    KEEP_DEPTHS
	  | REPLACE_DEPTHS  of int vector
	  | APPEND_DEPTH    of int
	  | REMOVE_DEPTH    of int
	datatype action =
	    KEEP_ACTIONS
	  | REPLACE_ACTIONS of (string * (value -> unit)) vector
	  | APPEND_ACTION   of string * (value -> unit)
	  | REMOVE_ACTION   of string

	datatype option =
	    NUMBER             of color *                 action
	  | FUNCTION           of color *                 action
	  | STRING             of color *                 action
	  | HOLE               of color *                 action
	  | FUTURE             of color *                 action
	  | CONSTRUCTOR        of color *                 action
	  | REFERENCE          of                         action
	  | FD                 of                         action
	  | FSET               of                         action
	  | TUPLE              of color * width * depth * action
	  | RECORD             of color * width * depth * action
	  | LIST               of color * width * depth * action
	  | CONSTRUCTED_VALUE  of         width * depth * action
	  | VECTOR             of color * width * depth * action
	  | RECORD_LABEL       of color
	  (* relation mode *)
	  | ALIAS_DEFINITION   of color
	  | ALIAS_REFERENCE    of color
	  (* ellipses *)
	  | WIDTH_ARROW        of color
	  | DEPTH_ARROW        of color
	  | PARENTHESES        of color
	  | MISC               of color
	  | TYPEDINDICATOR     of color
	  | PROMISE            of color
	  | PACKAGE            of color
          | CELL_POLL_INTERVAL of int

	exception ConfigurationError

	val inspect :   'a -> unit
	val inspectN :  int * 'a -> unit
	val configure : option vector -> unit
    end
  

________ Description _________________________________________________

type value

The abstract value type.

inspect x

displays x in the Inspector window.

inspectN (i, x)

displays x in the i-th Inspector window.

configure v

configures the options in v. Raises ConfigurationError in case something goes wrong.



last modified 1970/01/01 01:00