==================================================================

Filter takes an array or mapping, runs a test on each element,
and returns a new array or mapping that only contains the elements
that tested positively. The syntax is:

filter(array or mapping, function f);

The function f is the test, and you can specify it in a few ways.
For short or basic tests, a functional is the easiest:

  obs = filter(obs, (: $1->is_living() :) );

The part between (: :) is a functional, it works just like a function.
The $1 refers to the first item passed to it. For arrays, $1 will be
each element, in turn. For mappings $1 is the key, and $2 is the value
of that key. If you want to use other variables from your code,
you have to put them inside $(), such as $(name).

So this example will take everything in the array obs, and return
only the ones that are living. It is filtering out the other obs.

You can also use the "func_name" syntax for the function f, like so:

  obs = filter(obs, "func_name");
  int func_name(object ob) { return ob->is_living(); }

This function will be called once for each element, just like before.
