Returns a value of True if the named function fun returns a value of True for any argument supplied in the input list .
some? ( fun As Name, _ list As List ) As Boolean
Argument | Type | Description |
---|---|---|
fun | Name | The name of the function to apply. The function must accept a single "Any" parameter, and return a Boolean . |
list | list | List of arguments, to which the function will be applied. |
Intent >some?(:empty?, {{1}, {:a}, {}, {:b}}) --> TrueIn this example, the third element of the input list is empty, and therefore the empty? function returns True for it.
Intent >some?(:empty?, {{}, {:a}, {}, {:b}}) --> TrueIn this example, more than one of the list items matches the empty? predicate.
Intent >some?(:empty?, {{1}, {:a}, {2}, {:b}}) --> FalseHere, none of the list items matches the empty? predicate.
Intent >some?(:even?, {1, 2, 3, 4, 5}) --> TrueHere, 2 of the 4 list items causes a True return for the even? function.
Intent >some?(:even?, {1, 3, 5, 7, 9}) --> FalseHere, none of the list items is even, so no matches are found.