From: "David A. Black" Date: 2008-10-30T21:44:31+09:00 Subject: Re: Question about case statement and lambdas Hi -- On Thu, 30 Oct 2008, Brian Candler wrote: > David A. Black wrote: >> Expanding on Botp's point about options being changed: >> >> The problem is that if options is a Proc the first time you call the >> lambda, it isn't the second time. It's still whatever got assigned to >> it. > > And whilst at first glance it seems that 'options' is actually "just" a > local method argument which drops out of scope when the method returns, > it is of course bound into the environment of the lambda (i.e. the > closure), and persists there. Yes, I should have made that explicit -- I had the impression the OP was hip to that part. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!