filter pred xs
returns all elements of xs that fulfill the predicate pred
Source code:
set result {} foreach x $xs { if { [eval_unary $pred $x] } { lappend result $x } } return $result