Next: Popup Menus
Up: The Program Window
Previous: The Program Window
An unsafe operation is one which may be applied to
inappropriate arguments, thus raising an error. Unsafe operations are
a natural starting point for static debugging. MrSpidey highlights
these unsafe operations via font and color changes, as follows:
-
Any primitive
operation that may be applied to inappropriate arguments, thus raising
a run-time error, is highlighted in red (or underlined on monochrome
screens). Conversely, primitive operations that never raise errors are
shown in green.
-
Any function that may be applied to an incorrect
number of arguments is highlighted by displaying the lambda
keyword in red (again, underlined on monochrome screens).
-
Any application expression where the function position may return a
non-function is highlighted by displaying the enclosing parentheses in
red (or underlined).
Figure 2.1 contains examples of these three
different kinds of unsafe operations. The tab key moves the
focus forward to the next unsafe operation, and the shift-tab
key moves the focus backward to the previous unsafe operation. These
keystrokes make it easy to inspect the unsafe operations in a program.
Figure 2.1: Identifying unsafe operations
PLT