From: Jeff Date: 2008-10-30T22:39:40+09:00 Subject: Re: Question about case statement and lambdas On Oct 29, 10:47 pm, "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. > > Say options.call(*args) returns "Hello!". The second time you call the > lambda, options will be "Hello!", and not a Proc. "Hello!" will then > be sent to Scope.new, which is probably not going to be right. > > That's why you need a temporary variable or an inlined conditional. > You don't want to trample the options variable itself, since it's the > only place where the original options are stored. > > 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! > Seehttp://www.rubypal.comfor details and updates! Ah! Thanks for that explanation! Makes perfect sense now. Jeff purpleworkshops.com