This manual defines the core PLT Scheme language and describes its
most prominent libraries. The companion manual
A Guide to PLT Scheme provides
a friendlier (though less precise and less complete) overview of the
language.
1 Evaluation Model |
1.1 Sub-expression Evaluation and Continuations |
1.2 Tail Position |
1.3 Multiple Return Values |
1.4 Top-Level Variables |
1.5 Objects and Imperative Update |
1.6 Object Identity and Comparisons |
1.7 Garbage Collection |
1.8 Procedure Applications and Local Variables |
1.9 Variables and Locations |
1.10 Modules and Module-Level Variables |
1.10.1 Module Phases |
1.10.2 Module Re-declarations |
1.11 Continuation Frames and Marks |
1.12 Prompts, Delimited Continuations, and Barriers |
1.13 Threads |
1.14 Parameters |
1.15 Exceptions |
1.16 Custodians |
|
2 Syntax Model |
2.1 Identifiers and Binding |
2.2 Syntax Objects |
2.3 Expansion (Parsing) |
2.3.1 Fully Expanded Programs |
2.3.2 Expansion Steps |
2.3.3 Expansion Context |
2.3.4 Introducing Bindings |
2.3.5 Transformer Bindings |
2.3.6 Partial Expansion |
2.3.7 Internal Definitions |
2.3.8 Module Phases |
2.4 Compilation |
2.5 Namespaces |
2.6 Inferred Value Names |
|
3 Core Syntactic Forms |
3.1 Literals: quote and #%datum |
3.2 Expression Wrapper: #%expression |
3.3 Variable References and #%top |
3.4 Locations: #%variable-reference |
3.5 Procedure Applications and #%app |
3.6 Procedure Expressions: lambda and case-lambda |
3.7 Local Binding: let, let*, letrec, ... |
3.8 Conditionals: if, cond, and, and or |
3.9 Definitions: define, define-syntax, ... |
3.10 Sequencing: begin, begin0, and begin-for-syntax |
3.11 Guarded Evaluation: when and unless |
3.12 Assignment: set! and set!-values |
3.13 Iterations and Comprehensions: for, for/list, ... |
3.13.1 Iteration and Comprehension Forms |
3.13.2 Deriving New Iteration Forms |
3.14 Continuation Marks: with-continuation-mark |
3.15 Quasiquoting: quasiquote, unquote, and unquote-splicing |
3.16 Syntax Quoting: quote-syntax |
3.17 Modules: module, ... |
3.18 Importing: require, require-for-syntax, require-for-template |
3.19 Exporting: provide and provide-for-syntax |
|
4 Core Datatypes |
4.1 Booleans |
4.2 Numbers |
4.2.1 Number Types |
4.2.2 Arithmetic |
4.2.3 Number Comparison |
4.2.4 Powers and Roots |
4.2.5 Trignometric Functions |
4.2.6 Complex Numbers |
4.2.7 Bitwise Operations |
4.2.8 Random Numbers |
4.2.9 Number–String Conversions |
4.3 Strings |
4.3.1 String Constructors, Selectors, and Mutators |
4.3.2 String Comparisons |
4.3.3 String Conversions |
4.3.4 Locale-Specific String Operations |
4.4 Byte Strings |
4.4.1 Byte String Constructors, Selectors, and Mutators |
4.4.2 Byte String Comparisons |
4.4.3 Bytes to/from Characters, Decoding and Encoding |
4.4.4 Bytes to Bytes Encoding Conversion |
4.5 Characters |
4.5.1 Characters and Scalar Values |
4.5.2 Character Comparisons |
4.5.3 Classifications |
4.5.4 Character Conversions |
4.6 Symbols |
4.7 Regular Expressions |
4.7.1 Regexp Syntax |
4.7.2 Additional Syntactic Constraints |
4.7.3 Regexp Constructors |
4.7.4 Regexp Matching |
4.8 Keywords |
4.9 Pairs and Lists |
4.9.1 Pair Constructors, Selectors, and Mutators |
4.10 Vectors |
4.11 Boxes |
4.12 Hash Tables |
4.13 Sequences |
4.13.1 Sequence Predicate and Constructors |
4.13.2 Sequence Generators |
4.14 Procedures |
4.15 Void and Undefined |
|
5 Structures |
5.1 Defining Structure Types: define-struct |
5.2 Creating Structure Types |
5.3 Structure Type Properties |
5.4 Structure Utilities |
5.5 Structure Type Transformer Binding |
|
6 Classes and Objects |
6.1 Creating Interfaces |
6.2 Creating Classes |
6.2.1 Initialization Variables |
6.2.2 Fields |
6.2.3 Methods |
6.2.3.1 Method Definitions |
6.2.3.2 Inherited and Superclass Methods |
6.2.3.3 Internal and External Names |
6.3 Creating Objects |
6.4 Field and Method Access |
6.4.1 Methods |
6.4.2 Fields |
6.4.3 Generics |
6.5 Mixins |
6.6 Object Serialization |
6.7 Object, Class, and Interface Utilities |
|
7 Units |
7.1 Creating Units |
7.2 Invoking Units |
7.3 Linking Units and Creating Compound Units |
7.4 Inferred Linking |
7.5 Generating A Unit from Context |
7.6 Structural Matching |
7.7 Extending the Syntax of Signatures |
7.8 Unit Utilities |
|
8 Contracts |
8.1 Flat Contracts |
8.2 Function Contracts |
8.3 Lazy Data-structure Contracts |
8.4 Object and Class Contracts |
8.5 Attaching Contracts to Values |
8.6 Building New Contract Combinators |
8.7 Contract Utilities |
|
9 Control Flow |
9.1 Multiple Values |
9.2 Exceptions |
9.2.1 Raising Exceptions |
9.2.2 Handling Exceptions |
9.2.3 Configuring Default Handling |
9.2.4 Built-in Exception Types |
9.3 Continuations |
9.4 Continuation Marks |
9.5 Breaks |
9.6 Exiting |
|
10 Concurrency |
10.1 Threads |
10.1.1 Creating Threads |
10.1.2 Suspending, Resuming, and Killing Threads |
10.1.3 Synchronizing Thread State |
10.2 Synchronization |
10.2.1 Events |
10.2.2 Channels |
10.2.3 Semaphores |
10.3 Thread-Local Storage |
10.3.1 Thread Cells |
10.3.2 Parameters |
|
11 Macros |
11.1 Pattern-Based Syntax Matching |
11.2 Syntax Object Content |
11.3 Syntax Object Bindings |
11.4 Syntax Transformers |
11.5 Syntax Object Properties |
11.6 Syntax Certificates |
11.7 Expanding Top-Level Forms |
11.7.1 Information on Expanded Modules |
|
12 Input and Output |
12.1 Ports |
12.1.1 Encodings and Locales |
12.1.2 Managing Ports |
12.1.3 Port Buffers and Positions |
12.1.4 Counting Positions, Lines, and Columns |
12.1.5 File Ports |
12.1.6 String Ports |
12.1.7 Pipes |
12.1.8 Structures as Ports |
12.1.9 Custom Ports |
12.2 Byte and String Input |
12.3 Byte and String Output |
12.4 Reading |
12.5 Writing |
12.6 The Reader |
12.7 The Printer |
12.8 Reader Extension |
12.8.1 Readtables |
12.8.2 Reader-Extension Procedures |
12.8.3 Special Comments |
12.9 Printer Extension |
|
13 Reflection and Security |
13.1 Namespaces |
13.2 Evaluation and Compilation |
13.3 Security Guards |
13.4 Custodians |
13.5 Thread Groups |
13.6 Structure Inspectors |
13.7 Code Inspectors |
13.8 Module Names and Loading |
13.8.1 Resolving Module Names |
13.8.2 Compiled Modules and References |
13.8.3 Dynamic Module Access |
|
14 Operating System |
14.1 Paths |
14.1.1 Manipulating Paths |
14.1.2 Unix and Mac OS X Paths |
14.1.3 Windows Path Conventions |
14.2 Filesystem |
14.2.1 Locating Paths |
14.2.2 Files |
14.2.3 Directories |
14.3 Networking |
14.3.1 TCP |
14.3.2 UDP |
14.4 Processes |
14.5 Time |
14.6 Environment and Runtime Information |
|
15 Memory Management |
15.1 Weak Boxes |
15.2 Ephemerons |
15.3 Wills and Executors |
15.4 Garbage Collection |
|
16 Running PLT Scheme |
16.1 Libraries and Collections |
|
Index |