From: Robert Klemme Date: 2005-09-26T22:11:42+09:00 Subject: Re: String#ggsub David A. Black wrote: > 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 :-) Ooops! I overlooked that one. /me smacks himself So the attribution should of course go to Yanagawa Kazuhisa (I never know which is the surname and which the christian name with asian names.). I'll shut up now. robert