From: "David A. Black" Date: 2005-09-26T21:52:46+09:00 Subject: Re: String#ggsub Hi -- On Mon, 26 Sep 2005, Robert Klemme wrote: > David A. Black wrote: >> Hi -- >> >> On Mon, 26 Sep 2005, Trans wrote: >> >>> Sorry, just woke up: >>> >>> def rep >>> r = yield until r.nil? >>> end >>> >> >> Or (modeled on some earlier suggestions): >> >> def rep >> true until yield.nil? >> end >> >> or if false is OK: >> >> def rep >> true while yield >> end >> >> I love watching Ruby code progressively disappear from the screen (and >> still be clear) :-) > > Definitely! Now you arrived at my solution - only you use true instead of > 1 (three more characters!). :-) I was basing it on: http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/157559 but was too lazy to look it up -- hence the vague attribution :-) David -- David A. Black dblack@wobblini.net