sort_array

./efun/sort_array · 594 B

From the archive driver-docs-3.2@238-07-dec-93.tar.gz

Download the archive   « Back to the archive contents

SYNOPSIS
	mixed *sort_array(mixed *arr, string greater_fun, object 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.

	The function 'greater_fun' in the object 'ob' 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.

EXAMPLES
	int *a;
	a = ({ ..... });
	sort_array(a, #'<)

SEE ALSO
	transpose_array(E), filter_array(E), map_array(E), alists(LPC)

Site Stats

Snippets: 1791
Codebases: 571