Return a copy of the list , having removed all members for which the function fun returns True .
removeIf? ( fun As Name, _
list As List ) As List
Argument | Type | Description |
---|---|---|
fun | Name | The name of the function to apply. The function must return a boolean . |
list | List | The list of arguments to which the test function will be applied. |
Intent >removeIf(empty?, { {:a}, {:b}, {}, {:d} })
--> {{:a}, {:b}, {:d}}
In this example, all empty sublists are removed. In this case, this results in the removal of only the third item in the input
list
. Intent >removeIf(integer?, {:a, :c, "b", :c, 1.1, 3, :c, 3, 2, 1})
--> {:a, :c, "b", :c, 1.1, :c}
Function integer?(item as Any) as Boolean
integer? = (typeName(item) = :integer)
End Function
Intent >removeIf(:even?, {1, 2, 3, 4, 5, 6, 7, 8})
--> { 1, 3, 5, 7 }