Re:What's wrong with this code, really?
by morsch on Friday September 16, 2011 @03:00PM
(#3005793)
The snippet I posted can easily be made into a generic function<T> that takes a collection<T> and a predicate<T>. For example, the Apache Commons library offers such a function for Java, so where available the code comes down to the fairly similar
Of course aside from being a bit more verbose, predicate needs to be an object (often a singleton), because you can't pass around functions.
[ Parent
| on HN ]
There are no comments on this comment yet.