This tutorial is designed to show you the
basics of the Dr. Scheme and MIT Scheme programming environments. This is not a
language tutorial, and thus it is a good idea to have language reference material handy.
The tutorial will be divided into three sections:
This section of the tutorial will describe the locations and the setup the MIT and Dr. Scheme programs.
Dr. Scheme is a windows based scheme environment with some extras. It has extensions that include a built in graphics package and other tidbits. Just for reference, Dr. Scheme is not related to Dr. Evil.
Dr. Scheme |
Dr. Evil |
The program files and libraries for Dr. Scheme are located on
(hopefully all) the Win NT machines in 232 and 329 at:
C:\Program
Files\PTL\DrScheme.exe
The program should be started from the start menu at:
Start : Programs : Desktop Tools : Dr. Scheme
The Dr. Scheme menu contains four programs : Dr. Scheme, Dr. Scheme Jr., Mr. Ed, and MzScheme. We will be using Dr. Scheme. The other programs have different language extensions and can be used to make application. Please see the reference manual if you are interested in information on these other programs.
Dr. Scheme allows you to turn off different language features. On startup, the first line of the interactions buffer tells you what level of the language you are using. If this level is either Beginner or Intermediate you will run into problems because many of the features this class uses are not implemented. To change the language setting go to the main menu: language: language settings. Make sure to use Advanced or Higher.
Dr. Scheme separates the environment into two portions. The interactions buffer is just like the MIT Scheme command line, and variables and functions can be declared there. The declarations buffer is contains the code that would be loaded from a file in MIT scheme. In Dr. Scheme opening a file can be accomplished by using the file:open selection of the menu. Dr. Scheme holds the code loaded code in a buffer so it may be edited without having to use an external text editor. Please read over the first portion of the users guide for further explanation.
Dr. Scheme has built in help menus located on the menu bar. .
MIT Scheme is a textual scheme environment. Since scheme is an interpreted language everything is entered at the command prompt. Available on orcas and sanjuan (instructional DEC alphas) and on the NT Lab machines. To run MIT Scheme on the Alphas, execute the following:
/cse/courses/misc_lang/axp/mit-scheme-7.3/bin/scheme
or to avoid typing all that, add the following line into the file .cshrc in your home directory:
set path = ( $path /cse/courses/misc_lang/axp/mit-scheme-7.3/bin/)
so that scheme is on your search path.
On the lab NT's MIT Scheme can be found under:
Start : Server Apps : MIT Scheme 7.4.2
Scheme uses a "read-eval-print loop" at the top level: read in an expression, evaluate it, then print the result. control-d exits.
If you get an error, you'll end up in the debugger. For now just type
(restart 1)
To read in the contents of a file named myprog.s, say
(load "myprog.s")
Typing <Control + C> then h gives you a brief overview of some of the key bindings
See the MIT Scheme User Manual for complete documentation on MIT scheme.