---559023410-1663602767-11267154799921 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1663602767-1126715479=:29921" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-1663602767-11267154799921 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 15 Sep 2005, Mauricio FernáÏdez wrote: > Just one minor comment: > > batsman@tux-chan:~$ cat /tmp/fdsfdsdsd.rb > class Foo > FIELDS = %w[name stuff foo bar] > attr_reader(*FIELDS) That's rather nice :-) [...] > def eql2?(other) > # maybe add self.class::FIELDS == other.class::FIELDS test plus rescue NameError ? Good point. > self.class::FIELDS.each{|m| break false if self.send(m) != other.send(m) } && true Nice optimisation! I was having enough of a job keeping my head around inject to think of that! [...] > Rehearsal ----------------------------------------------------- > a.eql1?(a): true 1.520000 0.000000 1.520000 ( 1.658224) > a.eql2?(a): true 0.880000 0.000000 0.880000 ( 0.970675) [and similar] That makes quite a difference. Thank you. > > -- > Mauricio Fernandez > Hugh > ---559023410-1663602767-11267154799921-- ---559023410-1663602767-11267154799921--