Short: New efun factorize()
From: Tubmud
Type: Feature
SYNOPSIS
varargs mapping factorize(mixed *tokens,closure f,mixed *args);
DESCRIPTION
The simul_efuns collected here are thought to help when creating
output that contains lists of anything (e.g. items).
varargs mapping factorize(mixed *tokens,closure f,mixed *args);
This function receives an array of things (strings, objects, ...),
a closure that is applied to each of the elements of the array
and omittable extra arguments for the closure. It returns a
mapping which's keys are the results of the calls to the closure
and which's values are arrays of the elements of the input that
all gave the same result.
EXAMPLES
return factorize(all_inventory(this_player()),#'creator);
/* returns ([ 0: ({ obj/tools/robe#1723,obj/tools/test/stack#1265 }),
* "alfe": ({ players/alfe/obj/cloak#1423 }) ]).
* This returns a mapping of all items this_player() carries and
* factorizes them after their creator (using the efun creator()).
*/
==> Useful. Similar to Unique-Array. Call it m_unique?