From: "Shot (Piotr Szotkowski)" Date: 2007-02-01T00:12:13+09:00 Subject: Re: Sane #hash implementation? --jE+K4o1MICf3EEet Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Mauricio Fernandez: > On Wed, Jan 31, 2007 at 06:37:14PM +0900, Shot (Piotr Szotkowski) wrote: >> what would be the benefit of defining #eql? >> in terms of Set#sort instead of Set#=3D=3D? > "None". You cannot just =20 > def eql?(o); sort =3D=3D o.sort end > either But I can class Block < Set def eql? other self =3D=3D other end end can=E2=80=99t I? Set#=3D=3D says that =E2=80=98the equality of each couple = of elements is defined according to Object#eql?=E2=80=99 and that, coupled with Block#hash, is enough for me to create a set of blocks acting the way I need it. Note: I need a set of blocks to consider two blocks the same if the blocks contain the same integers, i.e., I need two such blocks to be eql? and have the same hashes; the above seems to do it for me quite nicely=E2=80=A6 (Thaks a lot for your detailed explanation snipped here, I appreciate it very much and learned a lot from it!) > GC.disable # don't let this interfere I=E2=80=99m learning new things every day, this one will come in very handy. -- Shot --=20 My favourite was some time ago, and involved a female customer thanking "Mr. Daemon" for his effort trying to deliver her mail, and offering him a "good time" if he ever visited Sydney. -- Matt McLeod --jE+K4o1MICf3EEet Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFFwLHmi/mCfdEo8UoRAk0sAJ9VDMolMeIBZGyPTyhq5XkaQ3b9twCeNJrC dJVOd4KFdwDBGzdaVmJ4WdA= =xkNB -----END PGP SIGNATURE----- --jE+K4o1MICf3EEet--