ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
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...)

        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, the function will be called with
        each of the array 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.


        Note that 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().

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