Table of Contents
- Getting Started: Variables, Functions, and Syntax
- Variables
- Declaration and Typing
- Mutability
- Tuples
- Conditionals
- Pattern Matching
- An Exercise in Matching
- Looping
-
while
-
loop
-
for
- Expressions
- Functions
- Definition and Invocation
- Parameters and Return Values
- Yet More Exercise
- Program 1: Collatz
- The Collatz Conjecture
- Finding a Collatz Sequence
- Breaking Down the Code
- Final Exercises
- Starting to Corrode:
Pointers, Memory, Strings, and I/O
- Memory Management
- Boxes
- Pointer Types
- Ownership
- Owned Boxes
- Borrowed References
- Pointer Mutability
- Freezing Objects
- Lifetimes
- Vectors and Strings
- Vectors
- Strings
- Exercises
- Basic I/O
- Working with Standard Input (stdin)
- Files
- Error Handling
- Example: Secret Sharing
- Splitter
- Joiner
- Multi-Purpose Maps:
Structures, Traits, and Higher-Order Functions
- Structures
- Defining Structs
- Constructing Structs
- Traits
- Defining Traits
- Implementing Traits
- Higher-Order Functions
- Functions as Parameters
- Functions as Results
- Example: Mapping a List
- Tasks and Communication
- Task Properties
- Spawning a Task
- Task Communication
- Ports and Channels
- Multi-Tasking Map