Wrapping Up

Lazy enumerables seem magical when you first encounter them. In fact, even when you start unravelling the pieces that make up lazy enumerables, you will undoubtedly find interesting bits of Ruby that you might not have otherwise encountered.

Before writing this chapter, I had never encountered the Enumerator::Yielder, Enumerator::Generator, or Fiber classes. Thankfully, the Rubinius implementation of Enumerable[6] was a great help. Learning about the behavior of Fiber.yield was the “aha!” moment for me.

What’s Next

Ruby is a language that goes the extra mile to provide syntax that tries to do a lot with little ceremony, yet somehow manages to find just the right balance to make things very readable.

Beneath the pretty syntax lies some very sophisticated machinery, though. Diving deeper and developing a curiosity of what goes on under the hood is a satisfying and rewarding experience. As this slim volume has hopefully shown, Ruby has no short supply of such gems.

This book only looked at closures in Ruby. With that as a starting point, we explored building idiomatic DSLs, created rudimentary objects from scratch using only simple Ruby constructs, dug deep into enumeration, and learned how Ruby handles infinite sequences, just to name a few.

Where does that leave you, dear reader? I hope this book inspires you to find your own starting point. It doesn’t matter what language, technique, or concept. Find something that piques your interest, then dig away. Dig until you experience that warm satisfaction of discovery and understanding. Then go back to step 1.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.140.204