Contents
Contents
Preface About This Book
Chapter 1 Introduction
Chapter 2 Syntax
- Overview
- Libraries and Modules
- Bindings
- Macros
- Bodies
- Definitions
- Local Declarations
- Expressions
- Statements
- Parameter Lists
- Lexical Syntax
- Special Treatment of Names
- Top-Level Definitions
- Dylan Interchange Format
- Naming Conventions
Chapter 3 Program Structure
Chapter 4 Program Control
- Overview
- Function Calls
- Operators
- Assignment
- Conditional Execution
- Iteration
- Nonlocal Exits and Cleanup Clauses
- Multiple Values
- Order of Execution
Chapter 5 Types and Classes
- Overview
- The Type Protocol
- Classes
- Slots
- Instance Creation and Initialization
- Singletons
- Union Types
- Limited Types
Chapter 6 Functions
Chapter 7 Conditions
- Background
- Overview
- Signalers, Conditions, and Handlers
- Exception Handling
- Condition Messages
- Introspective Operations
Chapter 8 Collections
- Overview
- Collection Keys
- Iteration Stability and Natural Order
- Mutability
- Collection Alteration and Allocation
- Collection Alignment
- Defining a New Collection Class
- Tables
- Element Types
- Limited Collection Types
Chapter 9 Sealing
- Overview
- Explicitly Known Objects
- Declaring Characteristics of Classes
- Declaring Characteristics of Generic Functions
- Define Sealed Domain
Chapter 10 Macros
- Overview
- Extensible Grammar
- Macro Names
- Rewrite Rules
- Patterns
- Pattern Variable Constraints
- Templates
- Auxiliary Rule Sets
- Hygiene
- Rewrite Rule Examples
- Statement Macros
- Begin
- Block
- Case
- For
- If
- Method
- Select
- Unless
- Until
- While
- Definition Macros
- Define Class
- Define Constant
- Define Domain
- Define Generic
- Define Library
- Define Method
- Define Module
- Define Variable
- Operator Function Macros
- &
- |
- :=
- Additional Examples
- Test and Test-setter
- Transform!
- Formatting-table
- With-input-context
- Define Command
- Get-resource
- Completing-from-suggestions
- Define Jump-instruction
Chapter 11 The Built-In Classes
- Overview
- Objects
- Types
- Simple Objects
- Numbers
- General Numbers
- <number> [Open Abstract Class]
- Complex Numbers
- <complex> [Sealed Abstract Class]
- Reals
- <real> [Sealed Abstract Class]
- Floats
- <float> [Sealed Abstract Class]
- <single-float> [Sealed Class]
- <double-float> [Sealed Class]
- <extended-float> [Sealed Class]
- Rationals
- <rational> [Sealed Abstract Class]
- Integers
- <integer> [Sealed Class]
- Collections
- General Collections
- <collection> [Open Abstract Class]
- Explicit Key Collections
- <explicit-key-collection> [Open Abstract Class]
- Sequences
- <sequence> [Open Abstract Class]
- Mutable Collections
- <mutable-collection> [Open Abstract Class]
- <mutable-explicit-key-collection> [Open Abstract Class]
- <mutable-sequence> [Open Abstract Class]
- Stretchy Collections
- <stretchy-collection> [Open Abstract Class]
- Arrays
- <array> [Open Abstract Instantiable Class]
- Vectors
- <vector> [Open Abstract Instantiable Class]
- <simple-vector> [Sealed Abstract Instantiable Class]
- <simple-object-vector> [Sealed Instantiable Class]
- <stretchy-vector> [Open Abstract Instantiable Primary Class]
- Deques
- <deque> [Open Abstract Instantiable Primary Class]
- Lists
- <list> [Sealed Instantiable Abstract Class]
- <pair> [Sealed Instantiable Class]
- <empty-list> [Sealed Instantiable Class]
- Ranges
- <range> [Open Abstract Instantiable Primary Class]
- Strings
- <string> [Open Abstract Instantiable Class]
- <byte-string> [Sealed Instantiable Class]
- <unicode-string> [Sealed Instantiable Class]
- Tables
- <table> [Open Abstract Instantiable Primary Class]
- <object-table> [Open Abstract Instantiable Class]
- Functions
- Conditions
- General Conditions
- <condition> [Open Abstract Class]
- Serious Conditions
- <serious-condition> [Open Abstract Class]
- Errors
- <error> [Open Abstract Class]
- <simple-error> [Sealed Instantiable Class]
- <type-error> [Sealed Instantiable Class]
- <sealed-object-error> [Sealed Class]
- Warnings
- <warning> [Open Abstract Class]
- <simple-warning> [Sealed Instantiable Class]
- Restarts
- <restart> [Open Abstract Class]
- <simple-restart> [Sealed Instantiable Class]
- Aborts
- <abort> [Sealed Instantiable Class]
Chapter 12 The Built-In Functions
- Overview
- Constructing and Initializing Instances
- General Constructor
- make [Open Generic Function]
- make class #rest supplied-init-args #key ⇒ object [G.F. Method]
- make (singleton (<array>)) #key dimensions fill ⇒ array [Sealed G.F. Method]
- make (singleton (<deque>)) #key size fill ⇒ deque [Sealed G.F. Method]
- make (singleton (<range>)) #key from by to above below size ⇒ deque [Sealed G.F. Method]
- make (singleton (<table>)) #key size ⇒ object-table [Sealed G.F. Method]
- make (singleton (<vector>)) #key size fill ⇒ simple-object-vector [Sealed G.F. Method] make (singleton (<simple-vector>)) #key size fill ⇒ simple-object-vector [Sealed G.F. Method]
- make (singleton (<list>)) #key size fill ⇒ list [Sealed G.F. Method]
- Initialization
- initialize [Open Generic Function]
- initialize object #key ⇒ object [G.F. Method]
- slot-initialized? [Open Generic Function]
- Specific Constructors
- list [Function]
- pair [Function]
- range [Function]
- singleton [Function]
- limited [Function]
- limited (singleton (<integer>)) #key min max ⇒ type [Sealed G.F. Method]
- limited (singleton (<collection>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<explicit-key-collection>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<mutable-collection>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<stretchy-collection>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<mutable-explicit-key-collection>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<sequence>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<mutable-sequence>)) #key of size ⇒ type [Sealed G.F. Method]
- limited (singleton (<table>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<object-table>)) #key of size ⇒ type [Sealed G.F. Method]
- limited (singleton (<array>)) #key of size dimensions ⇒ type [Sealed G.F. Method]
- limited (singleton (<vector>)) #key of size ⇒ type [Sealed G.F. Method]
- limited (singleton (<simple-vector>)) #key of size ⇒ type [Sealed G.F. Method] limited (singleton (<stretchy-vector>)) #key of ⇒ type [Sealed G.F. Method] limited (singleton (<deque>)) #key of ⇒ type [Sealed G.F. Method]
- limited (singleton (<string>)) #key of size ⇒ type [Sealed G.F. Method]
- limited (singleton (<range>)) #key of ⇒ type [Sealed G.F. Method]
- type-union [Function]
- vector [Function]
- Equality and Comparison
- Logical Negation
- ~ [Function]
- Equality Comparisons
- == [Function]
- ~== [Function]
- = [Open Generic Function]
- object1 = object2 ⇒ boolean [G.F. Method]
- complex1 = complex2 ⇒ boolean [Sealed G.F. Method]
- collection1 = collection2 ⇒ boolean [G.F. Method]
- sequence1 = sequence2 ⇒ boolean [G.F. Method]
- list1 = list2 ⇒ boolean [Sealed G.F. Method]
- list = sequence ⇒ boolean [G.F. Method] sequence = list ⇒ boolean [G.F. Method]
- range1 = range2 ⇒ boolean [Sealed G.F. Method]
- ~= [Function]
- Magnitude Comparisons
- < [Open Generic Function]
- real1 < real2 ⇒ boolean [Sealed G.F. Method]
- character1 < character2 ⇒ boolean [Sealed G.F. Method]
- string1 < string2 ⇒ boolean [G.F. Method]
- > [Function]
- <= [Function]
- >= [Function]
- min [Function]
- max [Function]
- Arithmetic Operations
- Properties
- odd? [Function]
- even? [Function]
- zero? [Open Generic Function]
- zero? complex ⇒ boolean [Sealed G.F. Method]
- positive? [Open Generic Function]
- positive? real ⇒ boolean [Sealed G.F. Method]
- negative? [Open Generic Function]
- negative? real ⇒ boolean [Sealed G.F. Method]
- integral? [Open Generic Function]
- integral? object ⇒ false [G.F. Method]
- integral? real ⇒ boolean [Sealed G.F. Method]
- Arithmetic Operations
- + [Open Generic Function]
- complex1 + complex2 ⇒ complex [Sealed G.F. Method]
- * [Open Generic Function]
- complex1 * complex2 ⇒ complex [Sealed G.F. Method]
- - [Open Generic Function]
- complex1 - complex2 ⇒ complex [Sealed G.F. Method]
- / [Open Generic Function]
- complex1 / complex2 ⇒ complex [Sealed G.F. Method]
- negative [Open Generic Function]
- negative real1 ⇒ real2 [Sealed G.F. Method]
- floor [Function]
- ceiling [Function]
- round [Function]
- truncate [Function]
- floor/ [Function]
- ceiling/ [Function]
- round/ [Function]
- truncate/ [Function]
- modulo [Function]
- remainder [Function]
- ^ [Open Generic Function]
- complex ^ integer ⇒ number [Sealed G.F. Method]
- abs [Open Generic Function]
- abs complex ⇒ real [Sealed G.F. Method]
- logior [Function]
- logxor [Function]
- logand [Function]
- lognot [Function]
- logbit? [Function]
- ash [Function]
- lcm [Open Generic Function]
- lcm integer1 integer2 ⇒ integer3 [Sealed G.F. Method]
- gcd [Open Generic Function]
- gcd integer1 integer2 ⇒ integer3 [Sealed G.F. Method]
- Coercing and Copying Objects
- identity [Function]
- values [Function]
- General Coercion Function
- as [Open Generic Function]
- as collection-type collection ⇒ instance-of-collection-type [G.F. Method]
- as (singleton (<integer>)) character ⇒ integer [Sealed G.F. Method]
- as (singleton (<character>)) integer ⇒ character [Sealed G.F. Method]
- as (singleton (<symbol>)) string ⇒ symbol [Sealed G.F. Method]
- as (singleton (<string>)) symbol ⇒ string [Sealed G.F. Method]
- Coercing Case
- as-uppercase [Open Generic Function]
- as-uppercase character ⇒ uppercase-character [Sealed G.F. Method]
- as-uppercase string ⇒ new-string [G.F. Method]
- as-uppercase! [Open Generic Function]
- as-uppercase! string ⇒ string [G.F. Method]
- as-lowercase [Open Generic Function]
- as-lowercase character ⇒ lowercase-character [Sealed G.F. Method]
- as-lowercase string ⇒ new-string [G.F. Method]
- as-lowercase! [Open Generic Function]
- as-lowercase! string ⇒ string [G.F. Method]
- Copying Objects
- shallow-copy [Open Generic Function]
- shallow-copy collection ⇒ new-collection [G.F. Method]
- type-for-copy [Open Generic Function]
- type-for-copy object ⇒ type [G.F. Method]
- type-for-copy mutable-collection ⇒ type [G.F. Method]
- type-for-copy limited-collection ⇒ type [Sealed G.F. Method]
- type-for-copy range ⇒ <list> [Sealed G.F. Method]
- type-for-copy limited-range ⇒ <list> [Sealed G.F. Method]
- Collection Operations
- Collection Properties
- empty? [Open Generic Function]
- empty? collection ⇒ boolean [G.F. Method]
- size [Open Generic Function]
- size collection ⇒ integer-or-false [G.F. Method]
- size array ⇒ size [G.F. Method]
- size list ⇒ integer-or-false [Sealed G.F. Method]
- size range ⇒ size [Sealed G.F. Method]
- size table ⇒ size [Sealed G.F. Method]
- size-setter [Open Generic Function]
- rank [Open Generic Function]
- rank array ⇒ rank [G.F. Method]
- row-major-index [Open Generic Function]
- row-major-index array #rest subscripts ⇒ index [G.F. Method]
- dimensions [Open Generic Function]
- dimensions vector ⇒ sequence [G.F. Method]
- dimension [Open Generic Function]
- dimension array axis ⇒ dimension [G.F. Method]
- key-test [Open Generic Function]
- key-test sequence ⇒ test-function [Sealed G.F. Method]
- key-test table ⇒ test-function [Sealed G.F. Method]
- key-sequence [Open Generic Function]
- Selecting Elements
- element [Open Generic Function]
- element simple-vector index #key default ⇒ element [Sealed G.F. Method]
- element unicode-string index #key default ⇒ character [Sealed G.F. Method]
- element byte-string index #key default ⇒ character [Sealed G.F. Method]
- element table key #key default ⇒ element [Sealed G.F. Method]
- element-setter [Open Generic Function]
- element-setter new-element simple-vector index [Sealed G.F. Method] ⇒ new-element
- element-setter new-value table key [Sealed G.F. Method]
- element-setter character unicode-string index [Sealed G.F. Method] ⇒ character
- element-setter character byte-string index ⇒ character [Sealed G.F. Method]
- aref [Open Generic Function]
- aref array #rest indices ⇒ element [G.F. Method]
- aref-setter [Open Generic Function]
- aref-setter new-value array #rest indices ⇒ new-value [G.F. Method]
- first [Function]
- second [Function]
- third [Function]
- first-setter [Function]
- second-setter [Function]
- third-setter [Function]
- last [Open Generic Function]
- last-setter [Open Generic Function]
- head [Function]
- tail [Function]
- head-setter [Function]
- tail-setter [Function]
- Adding and Removing Elements
- add [Open Generic Function]
- add! [Open Generic Function]
- add! deque new-value ⇒ deque [Sealed G.F. Method]
- add! stretchy-vector new-element ⇒ stretchy-vector [Sealed G.F. Method]
- add! list element ⇒ pair [Sealed G.F. Method]
- add-new [Open Generic Function]
- add-new! [Open Generic Function]
- remove [Open Generic Function]
- remove! [Open Generic Function]
- remove! deque value #key test count ⇒ deque [Sealed G.F. Method]
- remove! stretchy-vector element #key test count [Sealed G.F. Method] ⇒ stretchy-vector
- remove! list element #key test count ⇒ list [Sealed G.F. Method]
- push [Open Generic Function]
- pop [Open Generic Function]
- push-last [Open Generic Function]
- pop-last [Open Generic Function]
- Reordering Elements
- reverse [Open Generic Function]
- reverse range ⇒ new-range [Sealed G.F. Method]
- reverse! [Open Generic Function]
- reverse! range ⇒ range [Sealed G.F. Method]
- sort [Open Generic Function]
- sort! [Open Generic Function]
- Set Operations
- intersection [Open Generic Function]
- intersection range1 range2 #key test ⇒ range [Sealed G.F. Method]
- union [Open Generic Function]
- remove-duplicates [Open Generic Function]
- remove-duplicates! [Open Generic Function]
- Subsequence Operations
- copy-sequence [Open Generic Function]
- copy-sequence range #key start end ⇒ new-range [Sealed G.F. Method]
- concatenate [Function]
- concatenate-as [Function]
- replace-subsequence! [Open Generic Function]
- subsequence-position [Open Generic Function]
- Mapping and Reducing
- Simple Mapping
- do [Function]
- map [Function]
- map-as [Function]
- map-into [Function]
- any? [Function]
- every? [Function]
- Extensible Mapping Functions
- reduce [Open Generic Function]
- reduce1 [Open Generic Function]
- choose [Open Generic Function]
- choose-by [Open Generic Function]
- Other Mapping Functions
- member? [Open Generic Function]
- member? val range #key test ⇒ boolean [Sealed G.F. Method]
- find-key [Open Generic Function]
- remove-key! [Open Generic Function]
- remove-key! table key ⇒ table [Sealed G.F. Method]
- replace-elements! [Open Generic Function]
- fill! [Open Generic Function]
- The Iteration Protocol
- forward-iteration-protocol [Open Generic Function]
- forward-iteration-protocol table ⇒ initial-state limit next-state finished-state? current-key current-element current-element-setter copy-state [Sealed G.F. Method]
- backward-iteration-protocol [Open Generic Function]
- The Table Protocol
- table-protocol [Open Generic Function]
- table-protocol object-table ⇒ test-function hash-function [Sealed G.F. Method]
- merge-hash-codes [Function]
- object-hash [Function]
- Reflective Operations on Types
- Functional Operations
- Function Application
- Reflective Operations on Functions
- generic-function-methods [Function]
- add-method [Function]
- generic-function-mandatory-keywords [Function]
- function-specializers [Function]
- function-arguments [Function]
- function-return-values [Function]
- applicable-method? [Function]
- sorted-applicable-methods [Function]
- find-method [Function]
- remove-method [Function]
- Operations on Conditions
- Signaling Conditions
- signal [Function]
- error [Function]
- cerror [Function]
- break [Function]
- check-type [Function]
- abort [Function]
- Handling Conditions
- default-handler [Open Generic Function]
- default-handler condition ⇒ false [G.F. Method]
- default-handler serious-condition ⇒ {does not return} [G.F. Method]
- default-handler warning ⇒ false [G.F. Method]
- default-handler restart ⇒ {does not return} [Sealed G.F. Method]
- restart-query [Open Generic Function]
- restart-query restart ⇒ object [G.F. Method]
- return-query [Open Generic Function]
- Introspection on Conditions
- do-handlers [Function]
- return-allowed? [Open Generic Function]
- return-allowed? condition ⇒ false [G.F. Method]
- return-description [Open Generic Function]
- condition-format-string [Function]
- condition-format-arguments [Function]
- type-error-value [Function]
- type-error-expected-type [Function]
Chapter 13 Other Built-In Objects
Chapter 14 The Built-In Macros and Special Definitions
- Overview
- Definitions
- Local Declarations
- Statements
- Conditionals
- if [Statement]
- unless [Statement]
- case [Statement]
- select [Statement]
- Iteration Constructs
- while [Statement]
- until ( test ) [Statement]
- for [Statement]
- Other Statement Macros
- begin [Statement]
- block [Statement]
- Dynamic Extent of Block Features
- Intervening Cleanup Clauses
- Restrictions on the use of exit procedures
- method [Statement]
- Function Macros
Appendix A BNF
Appendix B Exported Names
- Overview
- Exported Classes
- Exported Functions
- Exported Constants
- Exported Defining Macros
- Exported Statement Macros
- Exported Function Macros