In Message-Id: <1127687058.509239.99690 / f14g2000cwb.googlegroups.com>
"Trans" <transfire / gmail.com> writes:

> Oh better:
> 
>   foo.gsub!( /.../, ... ) while $~

    irb(main):001:0> s = 'foo'
    => "foo"
    irb(main):002:0> s =~ /never match/
    => nil
    irb(main):003:0> s.gsub!(/\w/, '*') while $~
    => nil
    irb(main):004:0> s
    => "foo"

So that's not context free.

I tend to use

    true while s.gsub!(/.../, ...)

but probably OP doesn't like that because of extra `true'.


-- 
kjana / dm4lab.to                                     September 26, 2005
What is done can't be undone.