It is a commonly needed task to iterate over a list in order to find a particular item of interest. The code to do this could be implemented as a generic function where the caller provides a "match" routine to determine if the entry matches the one being searched for. Currently, this is implemented by iterating over the list, but code would read better and be simpler if this were consolidated into a function.
It is a commonly needed task to iterate over a list in order to find a particular item of interest. The code to do this could be implemented as a generic function where the caller provides a "match" routine to determine if the entry matches the one being searched for. Currently, this is implemented by iterating over the list, but code would read better and be simpler if this were consolidated into a function.