EFUN: map_mapping

SYNTAX:
mapping map_mapping( map, fun[, ob, extra1, extra2, ...] );
  mapping map;
  string fun | closure fun;
  object ob;
  mixed extra#;

DESCRIPTION:
This efun passes each of the indices of mapping 'map', and any 'extra#' (if
given) as arguments to a function 'fun' in object 'ob'. The value returned
by 'fun' will replace the original value to that index. If 'ob' is not
given, then this_object() is used by default.

RETURN VALUES:
A mapping is returned of which the values corresponding to each index
consist of the returned values (mixed)ob->fun( index, extra1, extra2, ... ).
Map_mapping does not change the contents of the original mapping.

SEE ALSO:
filter_mapping
map_array

EXAMPLE:
mapping map, min_square_map;

map = ([ "a":-2, "b":-1, "c":0, "d":1, "e":2, "f":3 ]);
min_square_map = map_mapping( map, "calc_min_square", this_object(), 1 );

int calc_min_square( string str, int min ) {
  if( map[str] < min  ) return 0;
  return map[str] * map[str];
}
// min_square_map is now ([ "a":0, "b":0, "c":0, "d":1, "e":4, "f":9 ])
