<P>I am understanding what you said about the difference between #= and #==, but I still get the same result. I am wondering is my logic somehow work or could I possibly be missing some type of punctuation because I know the object is there but it seems to always evaluate the false part and then prints out the type of the object that i am looking for.
<P>&nbsp;<B><I>Avi Bryant &lt;avi@beta4.com&gt;</I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>On Sun, 2 Feb 2003, Janet Abdul-Karim wrote:<BR><BR>&gt;<BR>&gt; I am trying to find a certain value in a collection. does something if true or does something if false and for some reason it always evaluates to false and I know its there. Any help would be great<BR>&gt;<BR>&gt; sample code.<BR>&gt;<BR>&gt; findAccount: accountNumber<BR>&gt; "Find the account with the argument number"<BR>&gt;<BR>&gt; self do:[:element | element number == accountNumber<BR>&gt; ifTrue:([Transcript show: element;cr])<BR>&gt; ifFalse:([Transcript show: 'No such account exists in this portfolio';cr])].<BR><BR>My guess is that you want to use #= (equality) not #== (identity<BR>equality). Numbers above a certain size are represented in such a way<BR>that they are not the same object even when they are the same number, and<BR>so they are #= but not #==. For example:<BR><BR>12 = 12 "true"<BR>12 == 12 "true"<BR>(12 raisedTo: 10) = (12 raisedTo: 10) "true"<BR>(12 raisedTo: 10) == (12 raisedTo: 10) "false"<BR><BR>Avi<BR><BR></BLOCKQUOTE><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>