Scheme

Scheme is an extremely expressive and elegant programming language. Its designers specified a very small and powerful set of features which subsume the features of many other languages.

In particular, in Scheme one can:

With these features, one can naturally define:

Expressing some features of other languages

The "Familiar" code in this section is not necessarily the best way to do things in Scheme. It does show that Scheme is so powerful that you can define the expressive features of many other languages. In fact some of the code in the next section takes these familiar features and improves them!

Familiar operations on variables.

Familiar iteration forms.

The essence of Objects

Non-lazy variant of Perl's gather-take. [New: 14 Mar 2006]

Ready-to-use Code

These assume an understanding of Scheme and are not necessarily for their pedagogical value. Still, the discussions leading up to the implementations contain a lot that is of general interest.

The definitions however are meant to be immediately usable in any R5RS Scheme (i.e. most of them), even for the many new Schemers who haven't yet learned macros. In particular each is self-contained even if it could have been defined more naturally in terms of another.

Control structures: when, unless, while, until, repeat with exit. [Updated: 16 Oct 2005]

Updating set!. [New: 9 Oct 2005]

Negation: of predicates, and overloaded. [New: 8 Oct 2005]

Macros: A Powerful Feature of Scheme (and other Lisp dialects)

My simplified macro system.

The following are summaries I made for myself and other lecturers: