ldmud-3.3.719/
ldmud-3.3.719/doc/
ldmud-3.3.719/doc/efun.de/
ldmud-3.3.719/doc/efun/
ldmud-3.3.719/doc/man/
ldmud-3.3.719/doc/other/
ldmud-3.3.719/mud/
ldmud-3.3.719/mud/heaven7/
ldmud-3.3.719/mud/lp-245/
ldmud-3.3.719/mud/lp-245/banish/
ldmud-3.3.719/mud/lp-245/doc/
ldmud-3.3.719/mud/lp-245/doc/examples/
ldmud-3.3.719/mud/lp-245/doc/sefun/
ldmud-3.3.719/mud/lp-245/log/
ldmud-3.3.719/mud/lp-245/obj/Go/
ldmud-3.3.719/mud/lp-245/players/lars/
ldmud-3.3.719/mud/lp-245/room/death/
ldmud-3.3.719/mud/lp-245/room/maze1/
ldmud-3.3.719/mud/lp-245/room/sub/
ldmud-3.3.719/mud/lp-245/secure/
ldmud-3.3.719/mud/sticklib/
ldmud-3.3.719/mud/sticklib/src/
ldmud-3.3.719/mudlib/deprecated/
ldmud-3.3.719/mudlib/uni-crasher/
ldmud-3.3.719/pkg/
ldmud-3.3.719/pkg/debugger/
ldmud-3.3.719/pkg/diff/
ldmud-3.3.719/pkg/misc/
ldmud-3.3.719/src/
ldmud-3.3.719/src/autoconf/
ldmud-3.3.719/src/ptmalloc/
ldmud-3.3.719/src/util/
ldmud-3.3.719/src/util/erq/
ldmud-3.3.719/src/util/indent/hosts/next/
ldmud-3.3.719/src/util/xerq/
ldmud-3.3.719/src/util/xerq/lpc/
ldmud-3.3.719/src/util/xerq/lpc/www/
ldmud-3.3.719/test/generic/
ldmud-3.3.719/test/inc/
ldmud-3.3.719/test/t-0000398/
ldmud-3.3.719/test/t-0000548/
ldmud-3.3.719/test/t-030925/
ldmud-3.3.719/test/t-040413/
ldmud-3.3.719/test/t-041124/
ldmud-3.3.719/test/t-language/
SYNOPSIS
        mixed * filter (mixed *arg, string fun, string|object ob
                                              , mixed extra...)
        mixed * filter (mixed *arg, closure cl, mixed extra...)
        mixed * filter (mixed *arg, mapping map, mixed extra...)

        string  filter (string arg, string fun, string|object ob
                                           , mixed extra...)
        string  filter (string arg, closure cl, mixed extra...)
        string  filter (string arg, mapping map, mixed extra...)

        mapping filter (mapping arg, string func, string|object ob
                                                , mixed extra...)
        mapping filter (mapping arg, closure cl, mixed extra...)

DESCRIPTION
        Call the function <ob>-><func>() resp. the closure <cl> for
        every element of the array, or mapping <arg>, and return a
        result made from those elements for which the function call
        returns TRUE.  The <extra> arguments are passed as additional
        parameters to the function calls and must not be references of
        array of mapping elements (like &(i[1]) ).

        If <ob> is omitted, or neither a string nor an object, it
        defaults to this_object().


        If <arg> is an array or struct, the function will be called with
        each of the array/struct values as first parameter, followed by the
        <extra> arguments. If the result from the function call is true,
        the array element in question is included into the efun result.

        If the efun is used with a mapping <map> instead of a function,
        every array element which is key in <map> is included into the
        result.


        If <arg> is a mapping, the function will be called with
        each of the mapping keys as first, and (if existing) the
        associated values as second parameter, followed by the <extra>
        arguments. If the result is true, the mapping element in question
        is included into the result.

        Depending on the width of the mapping <arg>, the function
        call takes one of three forms:

            widthof(arg) == 0: ob->func(key, 0, extra...)
                         == 1: ob->func(key, arg[key], extra...)
                          > 1: ob->func( key
                                       , ({ arg[key,0] ...arg[key,width-1] })
                                       , extra...)

        The advantage of this approach is that the two types of
        multi-dimensional mappings (mappings with multiple values
        per key, and mappings of arrays) can be treated in the same way.


        Historical Note: filter() used with arrays behaves like
        filter_array(), but used with mappings is a generalisation of
        filter_indices().


HISTORY
        Introduced in LDMud 3.2.6, obsoletes filter_array().
        LDMud 3.3.439 added filtering of strings.

SEE ALSO
        filter(E), filter_indices(E), map(E), walk_mapping(E), member(E),
        m_contains(E)