--s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 14, 2002 at 11:41:55PM +0900, Christoph wrote: > The problem is that some Enumerable classes like the Hash class or > a Set class (see for example rough/lib/set.rb - OT I am not sure why > this implementation doesn't include Comparable) don't know the > about the idea of multiple occurrences consequently you would > optimize #count to > > def count(c) > each {|e| return 1 if e == c } > return 0 > end > > which is sort of an indication (to me) that #count doesn't really into > Enumerable ... Considering Enumerables like Set or Hash as a degenerated Enumerable I find #count makes sense in Enumberable. Hash or Set can easily provide optimized versions of #count. It like find for a sorted list which can Mixin Enumerable and nevertheless have an optimized implementation of #min and #max -billy. -- Meisterbohne Söælinger StraÝÆ 100 Tel: +49-731-399 499-0 eLungen 89077 Ulm Fax: +49-731-399 499-9 --s/l3CgOIzMHHjg/5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9MZapfBriNoqItSYRArv/AJ9eMkZq0WbrdC068hxEK7zIVvJU6QCbBN8b zwzqHYQR1XMdFhq5OKudQL4 q2 -----END PGP SIGNATURE----- --s/l3CgOIzMHHjg/5--