EFUN: sort_array

SYNTAX:
mixed *sort_array( arr, before_fun[, ob] );
  mixed *arr;
  string before_fun | closure before_fun;
  object ob | string ob;

DESCRIPTION:
Sort_array sorts an array according to the comparison defined in the
function 'before_fun' in object 'ob'. It passes the elements of array
'arr' pairwise as arguments to 'before_fun'. 'Before_fun' must return
1 if the first argument is to be put before the second in the ordered
array. The object 'ob' may be given by its file_name. If no 'ob'
is given, then this_object() is used by default.

RETURN VALUE:
An array, sorted according to the return values of
ob->before_fun( elem1, elem2 ), is returned.

SEE ALSO:
filter_array
map_array

EXAMPLE:
string *str, *abc;

str = ({ "A", "l", "p", "h", "a", "b", "e", "t" });
abc = sort_array( str, "sort_alphabetical", this_object() );

int sort_alphabetical( string s1, string s2 ) {
  return s1 < s2;
}
// abc is now ({ "A", "a", "b", "e", "h", "l", "p", "t" })
