filter
skylib_fluffos_v3/mudlib/doc/driver/efuns/general/filter · 804 B
From the archive skylib_fluffos_v3.zip
Download the archive « Back to the archive contents
.DT filter $MUDNAME$ driver help filter .SH Name .SI 5 filter() - select certain elements .EI .SH Synopsis .SI 5 mixed filter( mixed x, string fun, object ob, mixed extra, ... ); mixed filter( mixed x, function f, mixed extra, ... ); .EI .SH Description .SP 5 5 The (ob, fun) syntax works as if (: call_other, ob, fun :) had been passed as `f'. Filter returns a new structure containing only the elements of `x' for which the function returns nonzero. Currently, it can be used on arrays and mappings. In the case of mappings, both the key and the value are passed to the function. `extra' and all the following arguments are passed to the function after the element. For example, filter(arr, fun, 2, 3) will first call fun(x[0], 2, 3) then fun(x[1], 2, 3) etc. .EP .SH See also .SI 5 map() .EI