Add to a collection

Janet Abdul-Karim jn_karim at
Mon Feb 3 00:00:37 UTC 2003

I created a subclass to ordered collections.  I am trying to add objects to the new class and then print it to make sure they are in there.  I add one object it prints but when I add another object and print it only prints the first object i added

sample code to add to list.

account: aAccount
 "Add an account to the portfolio"

 self isNil ifTrue:[self add: aAccount]
  ifFalse:[ self addLast: aAccount].


code to print list. 

 "Returns the accounts for the portfolio"

 self do:[:element|^element number].


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Squeak-dev mailing list