up previous next
MinBy    --    a minimum element of a list


Syntax
MinBy(L: LIST, LessThanFunc: FUNCTION)

Description
This function returns a minimum of the elements of the list L with respect to the comparisons made by LessThanFunc . (see MaxBy for details)

Example
/**/  Define ByLength(S, T)    -- define the sorting function
/**/    Return len(S) < len(T);
/**/  EndDefine;

/**/  L := ["bird", "mouse", "cat", "elephant"];
/**/  MinBy(L, ByLength);
cat

See Also