Pike v8.1 release 6

Method ADT.Set()->map()


Method map

array(mixed) map(function(:void) f)

Description

Map the values of a set: calls the map function f once for each member of the set, returning an array which contains the result of each one of those function calls. Note that since a set isn't ordered, the values in the returned array will be in more or less random order. If you need to know which member value produced which result, you have to make that a part of what the filtering function returns.

The filtering function f is called with a single, mixed-type argument which is the member value to be mapped.