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):
- Testcases:
- functional_api
Source code: lmap x $xs { if { ![$pred $x] } { continue } set x }XQL Not present: Generic, PostgreSQL, Oracle