Introductory Notes to use of DrRacket as a Scheme environment Barbara G. Ryder March 16, 2016 ****Where to find DrRacket to download to your PC or Mac? DrRacket is a programming environment which we will use to program in the Scheme programming language. Scheme is a simplified version of Lisp, a functional programming language first designed by Dr. John McCarthy in the mid-1950's, and STILL IN USE TODAY. We will be using a pure functional subset of the Scheme language with recursion replacing iteration and no assignment. To install the DrRackett programming environment on your computer, visit the Download tab at the website: http://racket-lang.org Click on the Download tab, choose Distribution "Racket" and select your system to download the latest version of the Racket environment. ****How I installed and configured DrRacket on my Mac The download is a *.dmg file which, when opened, installs the environment and then instructs you to move the Racket v6.4 folder to your Mac Applications folder. Once installed, you click on the DrRacket icon to open the environment interface, a window divided into upper and lower frames appears on your screen. Use the "Language" tab on the list of DrRacket options listed on the top left of your Mac's screen, to choose the version of Racket to install. Please click on "Teaching Languages" and choose "Intermediate Student with lambda". Then click the OK button. Finally click on the Run button on the top right corner of the upper window to install your choice of language etc. Similarly, you need to add Teachpack: docs.rkt so we can use some built-in functions from Scheme. You can setup font size, color, etc within DrRacket, but the defaults seem pretty good. (IMPORTANT NOTE: people have already asked me if they can use a different configuration or version of DrRacket for your Scheme programming assignment. The answer is "yes, but" meaning that (1) you are limited to use of built-in functions that are available to us in the version I have outlined and (2) you have to ensure that your Scheme ansswer runs and works properly in our version of the environment BEFORE you submit it for grading.) ****How to run Scheme programs in the environment? You can write Scheme functions directly into the upper frame and then hit the Run Button to check them for syntax errors. If you include a function application after the function definition (both in the upper frame) and then hit the Run Button, you will see the system check your function definition, highlight the body of the correct syntax definition, execute the fucntion application and produce the return value in the lower frame. Both frames can be saved by individual save commands on the File menu in DrRacket. Similarly you can load previously saved *.rkt files from the File menu. The really cool aspect of the environment is the STEP evaluation mode. When you have function defs and applications in the upper frame, you can hit the STEP button and a new window pops up to show you the execution "in slow motion" with each function evaluation shown. You use the new window's step-back, step-forward buttons to explore the execution (very good for complex debugging recursive function defs). Try this out with a simple function. ****How to comment out code or write comments to document your function defs? It seems that in our level of the DrRacket environment, to make a comment in the code requires you to type a semicolon ";" and then everything to the right of the semicolon is read by the system as a comment. If you need to comment out a large part of code (say when you are debugging several functions at the same time in the upper frame), #; means do not evaluate the following expression #| your commented out code goes here |# means ignore all the code inbetween these 2 double symbols...used for long pieces of code. To learn more, view this short video: https://www.youtube.com/watch?v=wc0XmXCm5MM ****DrRacket documentation Ok I find the actual DrRacket docs that come with the install fairly impentrable when looking for a particular "how to do this?" answer. But the Web had lots of videos about DrRacket which is a very popular teaching environment... so try the Web with your questions first. 3/16/2016 11:06am BGR