If we make these assumptions:
- An instance of the array is stored in a variable named employee
- Array contains a set of instances that all respond to the lastName message, returning an instance of String
- You want to sort the collection in ascending order.
Then you can complete the task with the following code snippet:
employees asSortedCollection: [ :a :b | a lastName < b lastName ]
asSortedCollection: Array employee. Block, , . , , , a b | . | SortedCollection.
, , , , . , ( , asSortedCollection:), , .