From: matz@... (Yukihiro Matsumoto) Date: 2002-11-19T11:57:18+09:00 Subject: Re: ruby-dev summary 18711-18810 Hi, In message "Re: ruby-dev summary 18711-18810" on 02/11/19, Paul Brannan writes: |but my naive solution in Ruby doesn't work: | | a = [1, 2, 3, 4, 5] | a.each_with_index do |x, idx| | puts x | if x == 3 then | a.delete_at(idx) | end | end | |(it skips the 4). | |Or is there a better way to write this that I am missing? a = [1, 2, 3, 4, 5] a.delete_if do |x| puts x x == 3 end matz.