Help - Glossary - O - OrderedCollection

An OrderedCollection is an indexed collection that may grow or shrink in size. Here is a simple example (use Cmd-d)

| oc |
oc := OrderedCollection new.
oc add: 'One'.
oc add: 'Two'.
oc inspect.

You can add or replace items in the lower pane of the inspector, for example like so (copy and Cmd-d in the lower pane of the inspector, on each line):

self add: 'Three'.
self at: 1 put: 'Ein'.

You will see that your entries change what's in the inspector. OrderedCollections are very handy. If you want to use keys other than integers, look at Dictionary.

Glossary - O