From: "David A. Black" Date: 2007-08-19T03:35:50+09:00 Subject: Re: Problem with Array#delete --1926193751-2036615464-1187462143=:4504 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-2036615464-1187462143=:4504" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-2036615464-1187462143=:4504 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sun, 19 Aug 2007, Matthew B Gardner wrote: >> I went a little different route, but that was indeed the problem. I just >> defined =3D=3D in my class, which I guess was comparing the class of the= object >> instead of the object_id. I did: >> >> def =3D=3D obj >> =A0=A0=A0=A0=A0=A0self.equal?(obj) >> end > > Ok, so it looks like this didn't work so well after all. Initially, I tho= ught > it did because I reloaded the character.rb file while the program was run= ning > and it worked fine. However, when I shutdown the program and started it b= ack > up, I experienced the same problem (though it again worked after reloadin= g > the file). I'll post all the necessary code: > > def world > =09returns the world object > end > > class World > =09def initialize > =09=09characters =3D [] > =09end > end Can you un-pseudo-code the code to the point where it does (or doesn't do) what you want? I can't make the thing you're describing happen when I try to get the code up and running, so a complete (non-)working example would be good. David --=20 * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com) --1926193751-2036615464-1187462143=:4504-- --1926193751-2036615464-1187462143=:4504--