Wrapping Up

By now you should understand Ruby’s scoping rules and also what closures are. You should also know how to identify a closure when you see one, and point out where the free variables are. You also know what first-class values are and how they are represented in Ruby.

You also implemented simple objects using only lambdas instead of classes. Then, you explored the inner workings of Enumerable#reduce, a very useful method/function in Ruby and especially other functional languages.

In the next chapter, we’ll look at blocks—one of the most unique features in the Ruby language. You’ll learn about the inner workings of enumeration and how to build beautiful DSLs.

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

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