Home     Overview     Materials     Assignments     Problem Set Submission     Software
CS212 Handouts
Scheme Quick Reference

This page is a quick reference describing briefly the syntax and functionality of the more useful things in Scheme.  The descriptions here are not meant to be the official documentation for the Scheme language.  For more information, or notes on how something in Scheme evaluates, consult the Revised5 Report on the Algorithmic Language Scheme.


Notation

Notation used in this handout:


Identifiers

You can use letters, numbers and "=", "-", ">", "<", "/", "*", "?", "!" and "+" in identifiers (names). "?" is typically used as a suffix for a predicate, "!" for state modification functions, "->" in the middle of type conversions (as in number->string), and ":" for symbols from different packages (as in primes:fast-prime?).


Values


Predicates

Scheme provides a predicate for each type it supports. Predicates are followed by ? and return either #t or #f

No input can satisfy more than one of these predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, procedure?.


Booleans

In addition, any object other than #f means true as well. It is good programming style however to use #t when you explicitly mean true.


Lists


Special Forms

Special forms are expressions that do not follow standard evaluation rules:


Equality Testing


List Structure Operators


Arithmetic and Numeric Operators


Vector Operators


Higher Order Functions




Valid HTML 4.0!CS212 Home Page
© 1999 Cornell University Computer Science
Written by Brandon Bray and Eli Barzilay