Sort using a custom comparator: Difference between revisions
Content added Content deleted
(→{{headerAppleScript}}: Passing a custom lengthDownAZup function to a generic sortBy function) |
|||
Line 168: | Line 168: | ||
-- SORTING LISTS OF ATOMIC (NON-RECORD) DATA WITH A CUSTOM SORT FUNCTION |
-- SORTING LISTS OF ATOMIC (NON-RECORD) DATA WITH A CUSTOM SORT FUNCTION |
||
-- In sortBy, f is a function from |
-- In sortBy, f is a function from () to a tuple of two parts: |
||
-- 1. a function from any value to a record derived from (and containing) that value |
-- 1. a function from any value to a record derived from (and containing) that value |
||
-- The base value should be present in the record under the key 'value' |
-- The base value should be present in the record under the key 'value' |