On May 17, 2007, at 08:20 , dkmd_nielsen wrote: > I have two rather simple class methods coded in Ruby...my own each > iterator: > > # Loop through each instruction in the block, yielding the result > from > # the specified code block. > def each(&logic) > @instructions.each {|instr| yield instr} > end > > # Find the specified instruction parm (string) in the block. > Returns > # nil if parm not found. > def find(p) > self.each {|i| return i if i.parm.index(p) } > nil > end I know it isn't what you're asking but FWIW, if you code #each and include Enumerable, you get this exact find for free.