Knave of Diamonds

Roland Swingler's tumblelog.

Programming, Design and all that good stuff.

3rd Sep

Closures in Ruby

Literate programming examples of the behaviour of closures & closure-like objects in Ruby. I knew about the LocalJumpError problem - the arity differences were new to me. As a bonus it also walks through using closures to implement lazy evaluation in Ruby.