A Guide to PLT Scheme
This guide is intended for programmers who are new to Scheme, new to PLT
Scheme, or new to some part of PLT Scheme. It assumes
programming experience, so if you are new to programming, consider
instead reading How to Design Programs. If you want a quick and pretty overview of PLT
Scheme, start with An Introduction to PLT Scheme with Pictures.
Chapter 2 provides a brief introduction to
Scheme. From Chapter 3 on, this guide dives
into details – covering much of the PLT Scheme toolbox, but leaving
precise details to PLT Scheme Reference and other reference manuals.
This guide describes a potential future version of PLT Scheme.
It does not match the current implementation.
1 Welcome to PLT Scheme |
1.1 Interacting with Scheme |
1.2 Definitions and Interactions |
1.3 A Note to Readers with Scheme/Lisp Experience |
|
2 Scheme Essentials |
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 |
|
3 Built-In Datatypes |
3.1 Booleans |
3.2 Numbers |
3.3 Characters |
3.4 Strings (Unicode) |
3.5 Bytes and Byte Strings |
3.6 Symbols |
3.7 Keywords |
3.8 Pairs and Lists |
3.9 Vectors |
3.10 Hash Tables |
3.11 Boxes |
3.12 Void and Undefined |
|
4 Expressions and Definitions |
4.1 Notation |
4.2 Identifiers and Binding |
4.3 Function Calls (Procedure Applications) |
4.3.1 Evaluation Order and Arity |
4.3.2 Keyword Arguments |
4.3.3 The apply Function |
4.4 Functions (Procedures): lambda |
4.4.1 Declaring a Rest Argument |
4.4.2 Declaring Optional Arguments |
4.4.3 Declaring Keyword Arguments |
4.4.4 Arity-Sensitive Functions: case-lambda |
4.5 Definitions: define |
4.5.1 Function Shorthand |
4.5.2 Curried Function Shorthand |
4.5.3 Multiple Values and define-values |
4.5.4 Internal Definitions |
4.6 Local Binding |
4.6.1 Parallel Binding: let |
4.6.2 Sequential Binding: let* |
4.6.3 Recursive Binding: letrec |
4.6.4 Named let |
4.6.5 Multiple Values: let-values, let*-values, letrec-values |
4.7 Conditionals |
4.7.1 Simple Branching: if |
4.7.2 Combining Tests: and and or |
4.7.3 Chaining Tests: cond |
4.8 Sequencing |
4.8.1 Effects Before: begin |
4.8.2 Effects After: begin0 |
4.8.3 Effects If...: when and unless |
4.9 Assignment: set! |
4.9.1 Guidelines for Using Assignment |
4.9.2 Multiple Values: set!-values |
4.10 Quoting: quote and ’ |
|
5 Programmer-Defined Datatypes |
5.1 Simple Structure Types: define-struct |
5.2 Structure Subtypes |
5.3 Opaque versus Transparent Stucture Types |
5.4 More Structure Type Options |
5.5 Structure Type Generativity |
|
6 Modules |
6.1 Module Basics |
6.2 Module Syntax |
6.2.1 The module Form |
6.2.2 The #module Shorthand |
6.3 Module Paths |
6.4 Imports: require |
6.5 Exports: provide |
6.6 Assignment and Redefinition |
|
7 Input and Output |
7.1 Varieties of Ports |
7.2 Default Ports |
7.3 Reading and Writing Scheme Data |
7.3.1 Serialization |
7.4 Bytes versus Characters |
|
8 Contracts |
|
9 Classes and Objects |
9.1 Methods |
9.2 Initialization Arguments |
9.3 Internal and External Names |
9.4 Interfaces |
9.5 Final, Augment, and Inner |
9.6 Controlling the Scope of External Names |
|
10 Exceptions and Control |
|
11 Iterations and Comprehensions |
11.1 Sequence Constructors |
11.2 for and for* |
11.3 for/list and for*/list |
11.4 for/and and for/or |
11.5 for/first and for/last |
11.6 for/fold and for*/fold |
11.7 Multiple-Valued Sequences |
11.8 Iteration Performance |
|
12 Regular-Expression Matching (Regexps) |
|
13 Pattern Matching |
13.1 Simple Dispatch: case |
|
14 Quasiquoting |
14.1 Escapes: quasiquote, unquote, and unquote-splicing |
14.2 Abbreviating with `, ,, and ,@ |
|
15 Units (Higher-Order Modules) |
|
16 Threads |
|
17 Syntactic Extension (Macros) |
17.1 Syntax Certificates |
|
18 Reflection and Dynamic Evaluation |
|
19 Reader Extension |
|
20 Security |
|
21 Memory Management |
21.1 Weak Boxes |
21.2 Ephemerons |
|
22 Performance |
|
23 Foreign-Function Interface (FFI) |
|
24 Scripts |
|
25 Graphical User Interfaces (GUIs) |
|
26 More Tools |
|
Index |