next up previous contents index
Next: The Interpreter Up: Introductory Scheme Previous: Contents

Introduction

 

Scheme is a small, versatile dialect of Lisp. Like Lisp, it is an applicative or functional language. This means that, unlike imperative languages, which are made up of sequences of instructions, applicative programs are based solely on functions and their return values. The only means of control is recursion. Functional languages are characterized by their lack of side effects , which are operations that change the state of some variable or environment. That is, an operation never modifies its argument; instead, it returns a copy of that argument that is identical to the original argument except for the changes specified by the function. This provides a property called referential transparency , which means that a function called with the same arguments will always exhibit the same behavior. Functions in imperative languages may depend on side effects or global variables, and thus referential transparency need not hold.

Section 2 describes the XScheme interpreter, its invocation, and a few control primitives for using the interpreter. Section 3 describes some fundamentals of the Scheme language, such as atoms, lists, and evaluation. Section 4 describes the boolean predicates available in Scheme, and Section 5 goes on to describe the control structures provided. Section 6 describes the mathematical operations provided in Scheme. Section 7 describes function definition, and Section 8 describes variable bindings and the use of local and global variables. Section 9 describes functions as first-class, i.e., using functions as arguments to, or return values from, functions, and also discusses unnamed (lambda) functions. Section 10 provides two programs as explanatory examples. Section 11 discusses some hints and techniques for simplifying the development and debugging process. Finally, Section 12 provides a few style guidelines and tips for programming in Scheme.



Steven J. Zeil
Tue Mar 4 14:36:27 EST 1997