The Racket Environment (Also see the documentation at http://racket-lang.org/ for more information.) 1. Starting the system Racket is available both as a text-based interpreter (Racket, invoked using "racket") and as a GUI-based development environment (DrRacket, invoked using "drracket"). When you invoke racket, a command processor starts running. It gives you a prompt at the terminal. You can then type an S-expression or load a program from a file. Racket evaluates the expression or the program, prints its value, and then presents another prompt. To exit Racket, type "(exit)". If you prefer to use DrRacket to write your code, you must start your code with a language declaration. For this course, we will be using the Racket language, hence your language declaration should be of the form "#lang racket". When you run DrRacket, a split window appears. The top half is used for defining procedures, and the bottom half is used for interaction (e.g. for testing your procedures, or for evaluating simple expressions). Note that procedures you define in the top window must be loaded using the "Run" button before they can be tested in the bottom window. 2. Files Source files must start with the line: #lang racket To load a source file in Racket, use (enter! "filename") where filename is the name of your file (e.g. a1a.rkt). To load a source file in DrRacket, simply use File->Open. Note that once the file is loaded, you need to Run it in order for the interaction half of the window to appear. 3. Debugging To use DrRacket's debugging tools, click on Debug (instead of Run). DrScheme allows you to set breakpoints, step through code, view the call stack, and examine variables. You can set breakpoints by right- clicking on the opening brackets of S-expressions. Beyond that, the debugging tools are mostly self-explanatory.