We will add detail to this page as we learn from you what needs to be clarified.
If you have any problems, please let us know, so we can update the page to cover
them.
When you write scheme code and evaluate it within the online tutor system,
it will be evaluated on the server that runs a slightly different scheme
interpreter, called SCM. As a result,
it may not necessarily include every function in the MIT Scheme
documentation. But, both MIT Scheme and the on-line system implement
the Scheme standard, which is documented here.
In general, you have two choices: you can run Scheme locally on your
machine, or directly on Athena. If you choose the former option, we
strongly encourage you to use the most recent version of
Scheme. Older or alternate versions (such as scheme for 6.001) may be
incompatible; for example, they might not preserve rationals (try (/ 1
3) ).
Running MIT Scheme (on PC's only)
If you have a PC, the current version of MIT Scheme is 7.7.90+ for
Linux (x86), Mac OS X (x86 and x86 64 bit),
OpenBSD and Windows - the exact list of supported
operating systems is given on the MIT Scheme site.
If you wish, you can also compile the package from source for any unix
system. MIT Scheme includes Edwin, a stripped-down version of
Emacs, as you may remember from 6.001. Go to MIT Scheme and
follow the instructions for installing it on your system.
You must also download onto your machine the homework files provided by us for
each homework assignment. There are links to these files on the assignment
page.
We are now supporting Dr. Scheme on an experimental basis. If you have
a mac, you might want to try this. For instructions on how to use
DrScheme with 6.034, please see these instructions
on obtaining and installing DrScheme for 6.034.
To run scheme on Linux-based Athena workstations, type the
following:
add scheme
scheme -edwin -edit
This will start the Edwin editor in the most recent version of Scheme
(better than the 6.001 version).
Once in Edwin, you may want to use the (cd "newdir")
command described in the bottom section to change your working directory.
We currently do not support running scheme on other types of
Athena workstations, such as Sun workstations, SGIs, or other
platforms, as the Scheme implementations on these platforms are
obsolete or broken. You will likely encounter problems if you try to
evaluate 6.034 code using MIT Scheme on these workstations.
MIT Scheme
documentation is available on line (at the download site). We are not
printing it because most people already have at least one copy of the basic
documents or are happy to access what they need on line.
Documentation for DrScheme is available here: PLT-scheme documentation page.
The Scheme for the on-line system is not MIT Scheme, so it will not necessarily
include every function in the MIT Scheme documentation. But, both MIT Scheme
and the on-line system implement the Scheme standard, which is documented
here.
Examples of Miscellanous Useful Scheme Stuff
(pp expression)
Pretty prints an expression.
(cd "/mit/6.034/ps1")
Changes the working directory.
(pwd)
Print the working directory.
(load "match.scm")
Loads and evaluates contents of a file (here, match.scm).
(trace function-name)
Shows the input arguments and output value when the function is called.
Redefining the function, such as by loading a file that defines it, undoes
the tracing.
(debug)
Shows you useful information when at an error breakpoint.
(load-option 'format)
Enables the use the format function. While you won't need to
use this, some assignments make use of it.
You may find a more comfortable general-purpose display function to be:
(define disp (lambda args
(letrec ((disp-in (lambda (arg)
(if (null? arg)
'Done
(begin
(display (car arg))
(disp-in (cdr arg)))))))
(disp-in args))))
which will allow you to do things such as:
(define foo 42)
(disp "The answer is " foo " nodes.")
and get:
Under Windows, you may want to reduce the font size using the option in the
menu of the upper-left system box.
Because Edwin is similar to Emacs, you may find the
Athena On-line Help
pages useful.
There are a number of key combinations that you may want to be aware of,
in case you missed them in 6.001. You can find these in the various
documentation files mentioned above. Here is a brief summary (C-
means hold down control; M- means hold down meta
or alt):
| C-x C-f | : Open a file, or create a new one |
| C-x C-s | : Save a file |
| C-x k | : Kill (close) a buffer |
| C-x C-c | : Exit Edwin |
|
| C-g | : Abort a command |
| C-x C-e | : Evaluate the previous expression |
| M-z | : Evaluate the expression surrounding the cursor |
| M-o | : Evaluate an entire buffer (careful!) |
| C-c C-c | : Quit from an error level after a bad evaluation |
| M-p | : Recall the last expression |
|
| C-space | : Mark the current cursor position |
| C-w | : Cut from current position to mark |
| M-w | : Copy from current position to mark |
| C-y | : Paste (yank) |
|
| C-x 2 | : Split screen vertically |
| C-x 5 | : Split screen horizontally |
| C-x 1 | : Return to non-split screen |
|
| M-x | : Enter a command by name (use tab to complete) |
|