You’ll be getting a separate message from Racket School central command about our room assignments for the week and evening events.
Setup instructions for our class are below. Please don’t wait until 8am Wednesday to start this! Once class begins, I’m afraid I won’t be able to stop and help sort out IT issues.
I will, however, be available in room 1460 of the Warnock Engineering Building from
Please have Racket v7.3 and DrRacket (or the Racket-editing environment you prefer) ready to go on your laptop. You can use Mac OS, Windows, or Linux. More detailed instructions here.
Please be familiar with how to open a terminal window and enter commands like cd and raco and racket.
Please install v1.6 of the beautiful-racket package:
1 | sh$ raco pkg install beautiful-racket |
If you’ve installed in the past, use
1 | sh$ raco pkg update beautiful-racket |
to ensure you have the newest version.
To check that it worked, try this on the command line (the -l switch tells racket to start with a particular module):
1 | sh$ racket -l br/test |
You should see this:
1 | You installed beautiful-racket v1.6 correctly. |
During the class, we’ll be working through a series of toy languages. Create a work directory for these languages somewhere convenient (e.g., in your home directory, or on your desktop). Call it whatever you want. But I’ll refer to it as the work directory.
Inside this directory, create an "info.rkt" file as follows:
1 2 | #lang info (define collection 'multi) |
This doesn’t do anything permanent or nefarious—it just makes the subdirectories of work accessible as Racket module paths (demo below).
From the command line, link this directory as a package:
1 2 | sh$ cd /path/to/work sh$ raco pkg install |
You’ll see a status message like this:
1 2 3 | Linking current directory as a package raco setup: version: 7.3.0.6 raco setup: platform: x86_64-macosx [3m] ··· |
In class, you’ll create subdirectories for the toy languages within this work directory. So the modules for #lang foo will go in /path/to/work/foo. Then they’ll be accessible from the #lang line in Racket.
To verify that this works, create a new foo/main.rkt file in your work directory:
1 2 3 4 5 6 7 8 | #lang br/quicklang (provide (rename-out [mb #%module-begin])) (define-macro (mb . _) #'(#%module-begin (displayln "You did it"))) (module reader syntax/module-reader foo) |
Then, in a new DrRacket window, run this source file:
1 | #lang foo |
This will produce the result:
1 | You did it |
After class ends—not now!—you can unlink the work directory:
1 | sh$ raco pkg remove work |