f::filter (public)

 f::filter pred xs

Defined in packages/acs-tcl/tcl/ad-functional-procs.tcl

Examples: f::filter f::even_p {3 1 4 1 5 9 2 6} = {4 2 6} f::filter [f::lambda {x} {expr $x>500}] {317 826 912 318} = {826 912}

Parameters:
pred (required)
xs (required)
Returns:
all elements of the list 'xs' that fulfill the predicate 'pred'.

Partial Call Graph (max 5 caller/called nodes):
%3 test_functional_api functional_api (test acs-tcl) f::filter f::filter test_functional_api->f::filter

Testcases:
functional_api
Source code:
    lmap x $xs {
        if { ![$pred $x] } {
            continue
        }
        set x
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: