Home Segments Index Top Previous Next

430: Mainline

You can iterate over the elements in a SortedCollection instance by using a do: message exactly like the do: message used with arrays, ordered collections, bags, or sets:

Workspace
(SortedCollection new add: 570; add: 720; add: 640; add: 720; yourself) 
  do: 
  [:element | Transcript show: element printString; space] 
Transcript 
570 640 720 720