From: Fearless Fool Date: 2011-03-22T01:52:59+09:00 Subject: scope of assignments with lambda This isn't a question -- it's just a comment that I find it awesome and only slightly mysterious that a lambda can reference the variable it is assigned to in its body, such as p here: >> p = lambda {|n| puts "bing #{n}" ; p.call(n-1) if n > 0 } >> p.call(5) bing 5 bing 4 bing 3 bing 2 bing 1 bing 0 => nil I guess that's the power of a real lexical closure. Very handy. -- Posted via http://www.ruby-forum.com/.