From: dave Date: 2005-06-15T17:42:08+09:00 Subject: code optimpization: delete_if, each, send. hi list, i've a query string like inname:ruby,opt the query is splitted in [ 'in', 'name', 'ruby', 'opt'] where 'in' is the name of a function (in-> true|false) that look inside an hash for a key 'name' and returns true if the value is 'ruby' || 'opt'. hashes are in an array called list. i would delete from the list array who doesn't match the query. ----------- list.delete_if(){ d = false tokens.each {|t| # method, args, object if (! d) d = true if send(t[0].to_sym, t[1], t[2..-1]) end b } } --------------- is there a better way? tnx. -- >here are more things in heaven and earth, horatio, than are dreamt of in your philosophy.