CS 115: Introduction to Computer Science 1

DrRacket & Teachpacks

Downloading DrRacket

Follow this link to a guide to downloading DrRacket for use at home.

Downloading a file

Teachpacks and documentation files can be found below. For PDFs, click on the link to download the file. For Teachpacks, right-click, or (if you have a one button mouse) hold down the control key and click the link, select ''Save Link As...''. In the window that pops up, click your username (left side of the window, under ''Places''), and ''Save''. Make sure that you save it to your personal folder (labeled with your userid) and that you keep track of where you have saved it.

Teachpacks and Documentation

Strings and Characters Documentation (PDF)
world.rkt Documentation (PDF)
Taxon Teachpack (taxon.rkt)
Compound Teachpack (compound.rkt)
Documentation (PDF)
Garb Teachpack (garb.rkt)
Documentation (PDF)
Office Teachpack (office.rkt)
Documentation (PDF)
Potatohead Teachpack (potatohead.rkt)
Documentation (PDF)
Product Teachpack (product.rkt)
Documentation (PDF)

Tips on using DrRacket

Starting DrRacket on the lab machines
There should be an icon in the dock (a red, blue and white circle) that you can click on. If not, in ''Finder'' under the ''Go'' menu at the top of the screen, select ''Applications''. Choose the ''Racket v6.1'' folder and then select ''DrRacket''.
Choosing a language
Click ''Language'' on the menu bar, and select ''Choose Language...''. In the dialog box that pops up, click on the triangle next to ''How to Design Programs'' (in the category ''Teaching Languages'') to see the choices of teaching languages. Click on ''Beginning Student'' (or the language level you need) and then on the ''OK'' button.
Help Desk
Click ''Help'' on the menu bar, and select ''Help Desk''. (If a warning dialog appears, click ''Open''.) In the browser window that opens up, under the category ''Languages'', click on ''How to Design Programs Languages''. Click the heading that is the language level you are using, such as ''Beginning Student''.
Unhelpful help
Avoid using the search box in the Help menu, as it does not confine the search to the documentation.
Opening a new file
Click ''File'' on the menu bar, and select ''New'' (or ''New Tab'', if you wish to add tabs to a current window). Keyboard shortcuts are ⌘N (new window) and ⌘= (new tab).
Opening an existing file
Click ''File'' on the menu bar, and select ''Open...'' (or ''Open Recent'' which provides you a list of your recently opened files). This will bring up a window that lets you select a file to open.
Saving a file
Click the ''Save'' button on the window (top of the your active window to the right, there is a blue floppy icon). If this is a new file, you will see a window that lets you choose a name for your file and a directory to put it in.
Loading a teachpack
A teachpack is a file with Scheme definitions in it. Loading a teachpack means you can use any of the definitions as if they were built-in definitions. Click ''Language'' on the menu bar, and select ''Add Teachpack...''. The left column of the window that pops up lists the ''Preinstalled Teachpacks'', choose the appropriate teachpack from the textbook (such as world.ss). For a course teachpack, first download the file from the website (see above). At the bottom of the right column of the window, click the ''Add Teachpack to List'' button. This will bring up a window that lets you browse to and select the teachpack you downloaded. Once the file has been added to the list, select it from the list ''User-installed Teachpacks'', and click ''Ok''. Then click "Run".
Clearing all teachpacks
Click ''Language'' on the menu bar, and select ''Clear All Teachpacks''.
Note: if you see the following (or something similar) at the top of your interactions window

"lib: standard-module-name-resolver: collection not found: "installed-teachpacks" in any of: (some path)

clear all your teachpacks and re-load the ones you need.
Commenting and uncommenting
Highlight the text in the Definitions window. Click ''Racket'' on the menu bar, and select ''Comment Out with Semicolons''. You can undo the change using ''Uncomment''. Do not use comment boxes, or your assignments will be unmarkable (i.e., you will receive zero (0) for that question).
Select a block of text in the Definitions window. Click ''Racket'' on the menu bar, and select ''Reindent''. You can also use ''Reindent All'' to reindent the entire program. To indent a single line, put the cursor on the line and press tab. Keyboard shortcut is ⌘I (reindent all),
Jumping to a definition
In the top left corner of your window is an arrow labelled ''(define ...)''. When you click here, you get a menu of all your definitions. You can choose whether they should be sorted by their order in the file or alphabetically.
Highlighted code
After you have run your program (keyboard shortcut ⌘T), any unused part of your code will be highlighted. This means that either you have code that is not needed (and should be removed), or that you need to add more tests (to test all aspects of your code). The default highlight colour is black.
Out of Memory
If the following message appears:

The evaluation thread is no longer running, so no evaluation can take place until the next execution. The program ran out of memory.

You have most likely created an infinite loop somewhere in your code. Fix your code and run it again. You should not need to increase your memory limit to accomodate any code you write for this course.
Valid XHTML 1.0 Strict Valid CSS!

Last modified on Monday, 01 June 2015, at 03:50 hours.

Course Supported by Instructional Support Group