From: Alan Chen Date: 2002-09-05T11:47:21+09:00 Subject: Re: Re-evaluating a 'case' On Thu, Sep 05, 2002 at 09:56:55AM +0900, Dan Debertin wrote: > I was reminded of this problem by the recent 'breaking out of case' > thread. I have a 'case' statement that evaluates a condition: > > case cond > when 'thing1' > ...do thing1 stuff... > when 'thing2' > ...do thing2 stuff... > cond = 'thing1' > end I don't think its better, and in some ways worse :) casefunc = proc { |cond| case cond when 'thing1' ...do thing1 stuff... when 'thing2' ...do thing2 stuff... cond = 'thing1' casefunc.call(cond) end } casefunc.call(cond) -- Alan Chen Digikata LLC http://digikata.com