BreakTool is a package that supports various fancy breakpoint facilities. These include breakpoints that occur only if some condition is true, breakpoints that evaluate expressions at each occurence, and breakpoints that log results at every occurence. All of these capabilities are provided by special expressions that can be evaluated at each breakpoint. A list of these expressions follows:
&abort[...] - raises ERROR ABORTED. Ignores any arguments.
&break[...] - evaluates its arguments, then causes a pseudo-breakpoint to occur at the point where the break was set.
&do[...] - evaluates its arguments repeatedly until the iteration is terminated (i.e. by &result[]).
&empty[] - evaluates its arguments, then returns the same non-printing result as would result from a procedure invocation with no returns.
&evq[...] - evaluates its arguments, then returns a TV for the last of its arguments.
&msg[...] - prints the results of evaluating its arguments. However, for any arguments that result in ROPEs, the printing is performed without quotes.
&print[...] - prints the results of evaluating its arguments. For any arguments that result in ROPEs, the printing is performed with quotes.
&prog[...] - evaluates its arguments, then returns the results of the last evaluation.
&result[...] - evaluates its arguments, then forces the termination of the nearest enclosing evaluation of one of the above special expressions. &result[] is the recommended way to terminate the evaluation of &do[].
To set a breakpoint that evaluates an expession at each occurence of the breakpoint, perform the following steps:
1. enter the expression into the Expr: window in the BreakTool
2. using the mouse, select the point where you want the breakpoint placed
3. click the Set button in the BreakTool
The BreakTool has the following buttons:
Set sets an evaluation breakpoint using the current Expr and selection
Clear clears the selected breakpoint
Clear * clears all breakpoints set by the BreakTool
List * lists all breakpoints set by the BreakTool
Eval evaluates the current Expr and prints the results
EvalSel evaluates the current selection as an expression and prints the results