| (array/mapping) <array/mapping>-><function>(<argument list>);
e.g.
/*
* I want a mapping where the indices are the names of the players
* in the game, and the values are their hit points.
*/
object *people, *names;
mapping hp_map;
// Get a list of all players.
people = users();
// Get their names.
names = people->query_real_name();
// Make a mapping to call with. Item = name:pointer
hp_map = mkmapping(names, people)
// Replace the pointers with hit point values.
hp_map = hp_map->query_hp();
// All this could also have been done simpler as:
hp_map = mkmapping(users()->query_real_name(), users()->query_hp());
|