Re:Ask YC: Ruby and Lisp devs, please answer this (Not a fla...
by Zak on Monday January 14, 2008 @03:57PM
(#98292)
Ruby has real closures with semantics similar to Lisp: lambda expressions that reference variables from their enclosing lexical scope. It also has a number of constructs that create closures implicitly, and some others that may or may not be implemented that way, but you're not required to use them. You can use closures just like you would in Lisp.
I took a look at that Closures in Ruby page you mentioned.
It says about Ruby: "This is quite a dizzing array of syntactic options, with subtle semantics differences that are not at all obvious, and riddled with minor special cases. It's like a big bear trap from programmers who expect the language to just work."