From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-05-29T20:20:51+09:00 Subject: Re: Array.extend versus instance.extend On Thu, 29 May 2003 20:56:34 +0900, Brian Candler wrote: > Another idea, "length != 0" could be replaced with "not empty?" Using 'until' instead of 'while' does reduce it even further :-) module ArrayMisc def shift_until(klass) res = [] until empty? or klass === first res << self.shift end res end def pop_until(klass) res = [] until empty? or klass === last res.unshift(self.pop) end res end end -- Simon Strandgaard