[Newbies] Array vs OrderedCollection

Miguel Enrique Cobá Martínez miguel.coba at gmail.com
Sun Apr 26 21:00:24 UTC 2009

Hi all,

are there any reason to prefer:

"adding 2 objects"
array := Array with: anObject.
array := array copyWith: aSecondObject
"removing object"
array := array copyWithout: aSecondObject.

instead of:

"adding 2 objects"
oc := OrderedCollection new.
oc add: anObject.
oc add: aSecondObject.
"removing object"
oc remove: aSecondObject ifAbsent: []

This in reference to

Class >> addSubclass: and Class >> removeSubclass: methods

Thanks for any answers
Miguel Cobá

More information about the Beginners mailing list