1.1 Buttons🔗

The left end of the row of buttons in DrRacket contains a miniature button with the current file’s name. Clicking the button opens a menu that shows the file’s full pathname. Selecting one of the menu entries produces an open-file dialog starting in the corresponding directory.

Beside the filename button is a (define ...) button for a pop-up menu of names that are defined in the definitions window. Selecting an item from the menu moves the insertion point (blinking caret) to the corresponding definition.

The Save button appears whenever the definitions window is modified. Clicking the button saves the contents of the definitions window to a file. The current name of the file appears to the left of the Save button, but a file-selection dialog appears if the file has never been saved before.

The Step button—which appears only for the How to Design Programs teaching languages Beginning Student through Intermediate Student with Lambdastarts the Stepper, which shows the evaluation of a program as a series of small steps. Each evaluation step replaces an expression in the program with an equivalent one using the evaluation rules of DrRacket. For example, a step might replace (+ 1 2) with 3. These are the same rules used by DrRacket to evaluate a program. Clicking Step opens a new window that contains the program from the definitions window, plus several new buttons: these buttons allow navigation of the evaluation as a series of steps.

The debugging interface is described further in Graphical Debugging Interface, later in this manual.

The Debug button—which does not appear for the How to Design Programs teaching languages—starts a more conventional stepping debugger. It runs the program in the definitions window like the Run button, but also opens a debugging panel with several other buttons that provide control over the program’s execution.

Clicking the Check Syntax button annotates the program text in the definitions window. It adds the following annotations:

Check Syntax also runs automatically as you edit your program, and the bottom, rightmost corner of the DrRacket window shows its status. A red dot means that something has gone wrong; move your mouse over the dot to find out what is wrong.

When nothing goes wrong, the colors indicate the stages processing of the program: blue (expanding), purple (computing check syntax information), orchid (updating the editor with the check syntax information), and green (finished).

Also, right-clicking (or control clicking) in that area yields a menu that lets you disable (or re-enable) automatic Check Syntax.

The Run button evaluates the program in the definitions window and resets the interactions window.

The Break button interrupts an evaluation, or beeps if DrRacket is not evaluating anything. For example, after clicking Run or entering an expression into the interactions window, click Break to cancel the evaluation. Click the Break button once to try to interrupt the evaluation gracefully; click the button twice to kill the evaluation immediately.