Because the "select:" method is defined in the abstract class Collection, it can also be used like this: | rectangles aPoint collisions | rectangles := OrderedCollection with: (Rectangle left: 0 right: 10 top: 100 bottom: 200) with: (Rectangle left: 10 right: 10 top: 110 bottom: 210). aPoint := Point x: 20 y: 20. collisions := rectangles select: .
Protože je metoda select: definována ve třídě Collection, může se použít i takto | obdelniky bod | obdelniky := OrderedCollection with: (Rectangle left: 0 right: 10 top: 100 bottom: 200) with: (Rectangle left: 10 right: 10 top: 110 bottom: 210). bod := Point x: 20 y: 20. kolize := obdelniky select: .