Please do not send messages about DrScheme to Rice University; send them to your TA instead. The TA's will contact Rice if necessary.
Also get the file initdr.scm from ftp.cs.utexas.edu/pub/novak/cs307/ A good place to put it is in the directory C:\ProgramFiles\Plt (where DrScheme.exe is).
DrScheme can also be started from the directory C:\ProgramFiles\Plt by double-clicking on its red-and-blue "lambda" icon.
The language level you should be using is called Graphical Full Scheme (MrEd). Lab machines start up this way. If your DrScheme does not show this level, click the Language button at the top, then Choose Language. Set the language level to Full Scheme. Then click the Execute button to reset the language level; it should remain set thereafter. (If you try loading the init file initdr.scm before setting the language level, it will give an error.)
Before loading files, you will need to set the directory path, e.g.:
(current-directory "c:/program files/plt/")
A good way to use DrScheme is to use the top half of the window (the Definitions window) to input your functions; be sure to save your definitions to a file frequently. When you press the Execute button, DrScheme will restart and read in your function definitions. You can test your definitions by typing in test calls in the lower half of the window (the Interactions window).
You should begin your file with the following:
; Your Name CS 307 Assignment n Date (current-directory "c:/program files/plt/") ; or other path (load "initdr.scm")
Under the File menu in the menu bar at the top are commands:
Executing Expressions: First, load your programs by clicking the Execute button (green arrow) above the top window. This will read in, check, and compile your programs. If there are problems, it will tell you. You can also use (load "myfile.scm") in the Interactions window to load a file.
Type in an expression at the > prompt in the lower Interaction window. The expression may extend over multiple lines. The expression will be executed when you type Return with balanced parentheses. Use the Interaction window to test programs, but always make files containing your programs rather than just typing them in to the interpreter.
Documentation: On-line documentation is available under Help. There is lots of useful information about Scheme and programming.
Disks: You should save all of your programs on disks; some programs will be used again or expanded in later assignments. An experienced computer scientist has a healthy paranoia about magnetic media and keeps backup copies of things that are important. ``The dog ate my disk'' is not a valid excuse; you should have a backup copy. Remember that all your files will be erased from the lab computer when you logout, so save them to disk first.
Editing: DrScheme helps balance your parentheses; this is very important. The Tab key can be used to space over the beginning of a line to the proper position based on its level of parentheses; if you change your program, Tab will move a line to its correct position. Using a good, indented style will help you avoid errors. Several keys are defined under the Edit menu for editing; see the on-line documentation for others.
Printing Graphics: It is possible to print the graphics window by clicking the mouse in the graphics window to expose it, then entering Alt-PrintScreen; this will copy the contents of the graphics window to the clipboard. Then start Paint using Start-Programs-Accessories-Paint, use Paste to paste the clipboard into Paint, then Print from Paint.
Incremental Testing: If you write a big program and test the whole thing, chances are that it will not work the first time; it is likely to be hard to figure out why it didn't work, since there are many parts and there may be several errors. Scheme makes it easy to give some test data to each component, which lets you test that component alone and find errors much more easily. Make sure that the components work before trying the whole thing.
Tracing Functions: A great way to see what is happening inside your program is to trace it; this will print the input each time a function is entered and its output upon exit. Use the command (trace function) to trace a function and (untrace function) to turn it off.
Getting Out of Trouble: Your program may not work correctly the first time! Here are some kinds of trouble and ways to get out: