1 Welcome to PLT Scheme
2 Scheme Essentials
3 Built-In Datatypes
4 Expressions and Definitions
5 Programmer-Defined Datatypes
6 Modules
7 Contracts
8 Input and Output
9 Regular Expressions
10 Exceptions and Control
11 Iterations and Comprehensions
12 Pattern Matching
13 Classes and Objects
14 Units (Components)
15 Reflection and Dynamic Evaluation
16 Macros
17 Performance
18 Running and Creating Executables
19 Compilation and Configuration
20 More Libraries
Bibliography
Index
Version: 4.0.2

 

2 Scheme Essentials

This chapter provides a quick introduction to Scheme as background for the rest of the guide. Readers with some Scheme experience can safely skip to Built-In Datatypes.

    2.1 Simple Values

    2.2 Simple Definitions and Expressions

      2.2.1 Definitions

      2.2.2 An Aside on Indenting Code

      2.2.3 Identifiers

      2.2.4 Function Calls (Procedure Applications)

      2.2.5 Conditionals with if, and, or, and cond

      2.2.6 Function Calls, Again

      2.2.7 Anonymous Functions with lambda

      2.2.8 Local Binding with define, let, and let*

    2.3 Lists, Iteration, and Recursion

      2.3.1 Predefined List Loops

      2.3.2 List Iteration from Scratch

      2.3.3 Tail Recursion

      2.3.4 Recursion versus Iteration

    2.4 Pairs, Lists, and Scheme Syntax

      2.4.1 Quoting Pairs and Symbols with quote

      2.4.2 Abbreviating quote with

      2.4.3 Lists and Scheme Syntax