unique values in collections

Daniel Vainsencher danielv at netvision.net.il
Thu Mar 13 06:50:50 UTC 2003


You're looking for a kind of collection that has unique items, not a
method. Sets are the abstraction you're looking for.

<print it->
#(2 2 3 4 5) asSet 

Daniel

Janet Abdul-Karim <jn_karim at yahoo.com> wrote:
> 
> --Boundary_(ID_C19L4DZG6/FROCt5YMtMlQ)
> Content-type: multipart/alternative;
>  boundary="Boundary_(ID_s4y+4TQKHxAS5cU/9YGo5Q)"
> 
> 
> --Boundary_(ID_s4y+4TQKHxAS5cU/9YGo5Q)
> Content-type: text/plain; charset=us-ascii
> Content-transfer-encoding: 7BIT
> 
> 
> I have a collection of portfolios and each portfolio has a collection of accounts.  I am trying to get the sum of the accounts, but my problem is if that some portfolios have the same account then that would not give me the write sum.  is there some method to make sure all value are unique in a collection
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> 
> --Boundary_(ID_s4y+4TQKHxAS5cU/9YGo5Q)
> Content-type: text/html; charset=us-ascii
> Content-transfer-encoding: 7BIT
> 
> <P>I have a collection of portfolios and each portfolio has a collection of accounts.&nbsp; I am trying to get the sum of the accounts, but my problem is if that some portfolios have the same account then that would not give me the write sum.&nbsp; is there some method to make sure all value are unique in a collection</P><p><br><hr size=1>Do you Yahoo!?<br>
> <a href="http://webhosting.yahoo.com/ps/wh3/prod/">Yahoo! Web Hosting</a> - establish your business online
> 
> --Boundary_(ID_s4y+4TQKHxAS5cU/9YGo5Q)--
> 
> --Boundary_(ID_C19L4DZG6/FROCt5YMtMlQ)
> MIME-version: 1.0
> Content-type: text/plain; charset=us-ascii
> Content-transfer-encoding: 7BIT
> 
> 
> 
> --Boundary_(ID_C19L4DZG6/FROCt5YMtMlQ)--



More information about the Squeak-dev mailing list