Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
 Acknowledgements
 Welcome!
Why This Book?
Who Is This Book For?
How to Use This Book
What’s in This Book
About Ruby Versions
Where to Go for Help
1. Closing in on Closures
The Foundations of a Closure
Simulating Classes with Closures
Implementing Callbacks in Ruby with Lambdas
Implementing Enumerable#reduce (or Fold Left)
Test Your Understanding!
Wrapping Up
2. Beautiful Blocks
Separating the General from the Specific
Executing Blocks with the yield Keyword
Blocks as Closures and Block Local Variables
Block Pattern #1: Enumeration
Block Pattern #2: Managing Resources
Block Pattern #3: Beautiful Object Initialization
Test Your Understanding!
Wrapping Up
3. The Power of Procs and Lambdas
Procs and the Four Ways of Calling Them
Lambdas—Same, But Different
How Symbol#to_proc Works
Currying with Procs
Test Your Understanding!
Wrapping Up
4. Building Your Own Lazy Enumerables
Understanding Lazy Enumerables
Building Our Skeleton
Implementing Lax
Implementing Lazy map
Implementing Lazy take
Test Your Understanding!
Wrapping Up
A1. Solutions
Chapter 1
Chapter 2
Chapter 3
Chapter 4
 Bibliography
← Prev
Back
Next →
← Prev
Back
Next →