Chapter 5: Page 89 - 'Creating a Comparison Function'

In this section, the function sortNameFunction should really be called compareByName and the text should be updated to reflect this. The implementation of the function should be as follows:

 function compareByName(a, b)
   if a.name < b.name then
     return true
   else
     return false
   end
 end

While this code is equivalent to the existing sortNameFunction definition, the concepts explored in this section can be lost when using the shorter example.