Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Preface
Who This Book Is For
Who This Book Is Not For
What This Book Will Do For You
How This Book Works
Etudes for Erlang
Why I Wrote This Book
Other Resources
Are You Sure You Want Erlang?
Erlang Will Change You
Conventions Used in This Book
A Note on Erlang Syntax
Using Code Examples
Help This Book Grow
Please Use It For Good
O’Reilly Safari
How to Contact Us
Acknowledgments
1. Getting Comfortable
Installation
Firing It Up
First Steps: The Shell
Moving through Text
Moving through History
Moving through Files
Doing Something
Calling Functions
Numbers in Erlang
Working with Variables in the Shell
Seeing Your Bound Variables
Clearing Bound Variables in the Shell
2. Functions and Modules
Fun with fun
Defining Modules
From Module to fun
Functions and Variable Scope
Module Directives
Documenting Code
Documenting Modules
Documenting Functions
Documenting Your Application
3. Atoms, Tuples, and Pattern Matching
Atoms
Pattern Matching with Atoms
Atomic Booleans
Guards
Underscoring That You Don’t Care
Adding Structure: Tuples
Pattern Matching with Tuples
Processing Tuples
4. Logic and Recursion
Logic Inside of Functions
Evaluating Cases
If This, Then That
Variable Assignment in case and if Constructs
The Gentlest Side Effect: io:format
Simple Recursion
Counting Down
Counting Up
Recursing with Return Values
5. Communicating with Humans
Strings
Asking Users for Information
Gathering Terms
Gathering Characters
Reading Lines of Text
6. Lists
List Basics
Splitting Lists into Heads and Tails
Processing List Content
Creating Lists with Heads and Tails
Mixing Lists and Tuples
Building a List of Lists
7. Higher-Order Functions and List Comprehensions
Simple Higher-Order Functions
Creating New Lists with Higher-Order Functions
Reporting on a List
Running List Values Through a Function
Filtering List Values
Beyond List Comprehensions
Testing Lists
Splitting Lists
Folding Lists
8. Playing with Processes
The Shell Is a Process
Spawning Processes from Modules
Lightweight Processes
Registering a Process
When Processes Break
Processes Talking Amongst Themselves
Watching Your Processes
Breaking Things and Linking Processes
9. Exceptions, Errors, and Debugging
Flavors of Errors
Catching Runtime Errors as They Happen
Raising Exceptions with throw
Logging Progress and Failure
Debugging through a GUI
Tracing Messages
Watching Function Calls
10. Storing Structured Data
Mapping Your Data
From Tuples to Records
Setting Up Records
Creating and Reading Records
Using Records in Functions and Modules
Storing Records in Erlang Term Storage
Creating and Populating a Table
Simple Queries
A Key Feature: Overwriting Values
ETS Tables and Processes
Next Steps
Storing Records in Mnesia
Starting up Mnesia
Creating Tables
Reading Data
Query List Comprehensions
11. Getting Started with OTP
The Origins of OTP
Creating Services with gen_server
A Simple Supervisor
Packaging an Application
12. Next Steps Through Erlang
Moving Beyond the Erlang Shell
Distributed Computing
Processing Binary Data
Input and Output
Testing, Analyzing, and Refactoring
Networking and the Web
Data Storage
Extending Erlang
Languages Built on Erlang
Community
Sharing the Gospel of Erlang
A. An Erlang Parts Catalog
Shell Commands
Reserved Words
Operators
Guard Components
Common Functions
Strings and Formatting
Data Types for Documentation and Analysis
B. OTP Templates
Index
← Prev
Back
Next →
← Prev
Back
Next →