From: Sebastian Hungerecker Date: 2007-12-26T18:41:16+09:00 Subject: Re: Index of the n-th occurrence Marco wrote: > 2) What's the simplest way to select elements of a vector,on the basis of a > condition on a second vector of the same length? res=[] [1,2,3,4].zip([2,4,9,16]) {|x,y| res << x if y==x*2} res #=> [1,2] HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826