From: Carlos Date: 2003-12-03T00:18:15+09:00 Subject: Re: anything disappearing from Ruby for 2.0? > > 4) while &{ line =~ /abc/ }..&{ line =~ /def/ } > > This needs a hidden flip-flop variable, otherwise matching > /abc/ will be performed each time. Yes, because a new Proc is created every time. I didn't notice that :(. I should have thought, if proc{...}==Proc.*new*{...}, that would be the case :). Sorry. > Of course, you can do it like this, but, hmmmm... > > (&{ line =~ /abc/ }..&{ line =~ /def/ }).while do > # ... > end And also, the flip-flop is mostly used with "if" inside an external loop. I think, if we want to keep this useful construction, must find another way...