Sorting via a Block

The second way to sort a collection is to use a Sort Block. A sort block takes two elements of the collection as parameter and should return a boolean describing if the first one should be before the second one. github

#('longstring' 'test' 'test2') sorted: [ :string1 :string2 | string1 size < string2 size ]. "#('test' 'test2' 'longstring')"