/doc/efun/sort_array


SYNOPSIS

mixed *sort_array(mixed *arr, string greater_fun, object|string ob)
mixed *sort_array(mixed *arr, closure cl)

DESCRIPTION

Returns an array sorted by the ordering function ob->greater_fun(a, b), resp by the closure expression. If 0 is given as first argument, 0 is returned.

The function 'greater_fun' in the object 'ob' (which may be also given as its file_name) is continously passed two arguments which are two of the elements of the array 'arr'. It should return true or a positive number if the first argument is greater than the second.

EXAMPLE

To sort an array in ascending order
	int *a;
	a = ({ ..... });
	sort_array(a, #'>)

SEE ALSO

transpose_array
filter_array
map_array
alists

| Home | Applied | Concepts | Efuns | Help | Intro | Lib | LPC | Prop | Obj | Sefuns | Std | W |

Nightfall@quest.tat.physik.uni-tuebingen.de
Automatically generated on Don, 11. Apr 1996