From: Martin DeMello Date: 2004-08-11T15:26:14+09:00 Subject: Re: empty? and size in Enumerable Ara.T.Howard wrote: > > my concern would be for code that created a temporary data structure to > iterate - the designer should re-design! ;-) seriously, the rbtree package > from the raa works exactly like an ordered hash and it does not do this - i > would say it's a serious flaw if an ordered container cannot iterate > itself in order w/o creating temp structures - though your point is > well taken and correct. class Foo include Enumerable def each sort_by(:constantly_changing_criterion).each {|i| yield i} end end But now that I think of it, there's nothing that says such a class couldn't override empty? martin