► |  | Guide: PLT Scheme

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
21 | Dialects of Scheme
| Bibliography
| Index

▼ | 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

top← prev up next →

#### 3.11`` Boxes

A box is like a single-element vector. It prints as #& followed by the printed form of the boxed value. A #& form can also be used as an expression, but since the resulting box is constant, it has practically no use.

Examples:
> (define b (box "apple"))
> b
#&"apple"
> (unbox b)
"apple"
> (set-box! b '(banana boat))
> b
#&(banana boat)

> > > Boxes in Reference: PLT Scheme provides more on boxes and box procedures.

top← prev up next →