One of a series of tutorials about Scheme in general
and the Wraith Scheme interpreter in particular.

Copyright © 2011 Jay Reynolds Freeman, all rights reserved.
Personal Web Site:

This is the first in a series of tutorials intended to help you learn the programming language Scheme in the particular context of the Macintosh&trade application "Wraith Scheme", or -- if you already are familiar with Scheme -- to help you learn how to use the Wraith Scheme program itself. The tutorials won't teach you everything about Scheme in general or about Wraith Scheme in particular, but I hope they will get you going. Furthermore, they are slanted heavily toward things of practical value, either for learning Scheme or for learning about the Wraith Scheme application.

There are many short tutorials in this series, all listed and accessed in the Wraith Scheme "Tutorials" menu. I expect there will be more in subsequent versions of Wraith Scheme. In general, the way you use any one tutorial is to open it in Safari&trade, and read it there while you are running Wraith Scheme in another window. From time to time you may wish to cut and paste an example of Scheme code from the tutorial into Wraith Scheme itself, to see what it does.

At this point, I will tempt fate by stating that it is hard to make Wraith Scheme crash. I won't tell you that it can't be done, but I will tell you that the program is pretty good about giving useful error messages when you make a mistake in typing, or don't do something correctly. So don't be timid: Don't be afraid to play with Wraith Scheme. I intended it to be a good tool for learning about programming in general and Scheme in particular, so I tried to make it as robust and informative as possible.

There is no completely sensible way to suggest in what order you should read these tutorials -- it depends a lot on your interests, your experience with Lisp-class programming languages, and your experience with Scheme in particular. In general, the ones nearer the top of the list in the "Tutorials" menu are simpler and more elementary than the ones nearer the bottom, but you may want to skip around to find topics of particular interest.

Probably the two most important tutorials are "Using the Interpreter" and "Using Built-In Help". Any newcomer to Wraith Scheme, even someone with vast prior experience with other implementations of Scheme, will almost certainly find something useful in them. Furthermore, the tutorial, "Editing a File" may provide some valuable, implementation-specific guidance on how to use Wraith Scheme in the process of writing, testing, and debugging Scheme source code: Wraith Scheme is set up so that you can editor you like to write your programs.

If you have little or no prior knowledge of Scheme, I suggest starting down the list of tutorials systematically, from the top, and not skipping around until you find some compelling reason to do so. The complete body of tutorials will present a modest amount of information about Scheme, but not everything, and they should also get you up to speed on how to use Wraith Scheme itself. Notwithstanding, you will certainly need other information sources, such as books or web pages, and you should certainly also look at the Wraith Scheme Help File and the Wraith Scheme Dictionary, which are available from within Wraith Scheme, via the Help Menu. Indeed, the last tutorial -- at the bottom of the Tutorials Menu -- is a bibliography of material on Scheme and related subjects that I have found interesting or useful, and sometimes even both.

If you are an experienced Scheme user, you might want to look at the tutorials about using various aspects of Wraith Scheme, and at the ones about its enhancements above and beyond the R5 requirements. Those should provide a good start on how to use this particular implementation.

Most of the tutorials are organized so that the easier and more basic material is at the beginning of the tutorial, with harder and more esoteric stuff at the end. Many tutorials use the basic material in their first part as the starting point for a subsequent discussion of some related matter that is more complicated. For example, the tutorial "Lists" introduces quoting and also introduces the idea of turning a data object -- a list -- into executable code.

A lot of information about topics of general interest is embedded within tutorials at a place where it is particularly useful. For example, Scheme has two procedures to print text -- "write" and "display". Rather than have a separate tutorial titled "Write and Display", I introduce these procedures and discuss their differences in the "Strings" tutorial, because that is the first place in the tutorials where the two procedures do something noticeably different. That kind of organization is perhaps another reason why you might consider at least skimming all of the tutorials.

Scheme is one of the more popular members of the Lisp family of programming languages. It has been widely used in artificial intelligence and in teaching computer programming. Wraith Scheme is a "programming language interpreter"; that is, it is a computer program that reads and executes statements in a particular programming language -- Scheme -- one at a time.

There is a formal standard for Scheme, and it has changed over the years. Wraith Scheme implements the so-called "R5" version, which is described in detail in Revised5 Report on the Algorithmic Language Scheme (1998), edited by Richard Kelsey, William Clinger and Jonathan Rees. That report is available on several Internet sites, such as R5 Scheme is not the newest version. As I write these words, the latest is "R6" Scheme, but I found R6 too complicated for just one person -- me -- to implement, so I stuck with R5. If you need an R6 Scheme, there are several available: Search the Internet to find the latest and greatest.

The version of Wraith Scheme used for these tutorials runs only on Apple Macintoshes that are new enough to have an Intel processors that can run 64-bit applications, and that are running Mac OS 10.6 (Snow Leopard) or later. There is an older version of Wraith Scheme available, that will also run on Macintoshes that have Intel 32-bit processors or PowerPC processors, and that are running Mac OS versions as old as 10.4 (Tiger).

You may download the latest versions of these applications from the "Software" page of my web site, That page also describes several other Scheme-related applications I have written, including the Apple iPad&trade app, "Pixie Scheme III".

The big problem with me writing tutorials is that I have been creating Scheme interpreters and coding up Scheme programs for decades: I am probably too familiar with these matters to be aware of all the problems and questions a newcomer might have. So If you have any problem with any of these tutorials, or for that matter, with anything else having to do with Wraith Scheme, by all means, let me hear from you.

Good luck, and have fun!

-- Jay Reynolds Freeman (

Wraith Face