MIT Scheme pointers
Some of the functions listed below assume you have installed
the CS441 Scheme extensions.
Useful REPL commands
- (load "file.scm") executes the Scheme expressions in "file.scm"
- (pwd) prints the current working directory
- (cd "wherever") changes the current working directory
Dealing with Errors
The Scheme prompt includes a number that increments as you make errors.
If you are brave, you can refer to these numbers with the debugger
to investigate context at different errors. C-c C-c pops and
discards one level of error context, in both the ordinary
REPL and under Emacs.
Useful Functions and Special Forms
-
(printf format-string arg ...)
is like C's printf, except that
the escape characters are different:
-
~%
is a newline
-
~a
inserts an argument value (of any type)
-
(define-record name (field ...))
builds the following
abstract representation functions:
-
make-name
- constructor
-
name?
- predicate
-
name->field
... - selectors
-
(variant-case exp (name (field ...) exp ...) ...)
pattern matches on records (see EOPL).
-
extend-syntax
adds new syntactic forms (see EOPL).