Suppose I have a single element, and I have a list of predicates (functions). I want to apply each of these predicates to the single element and get a corresponding list of return values. I know that map
and friends can apply a single function to each a list of arguments, but is there any concise syntax to apply many functions to a single argument?
Of course I can do
(mapcar (lambda (pred) (funcall pred SINGLE-ELEMENT)) LIST-OF-PREDICATES)
but it would be nice if there was a function that worked like:
(test-predicates-against-element LIST-OF-PREDICATES SINGLE-ELEMENT)
Obviously I can just defun
it, but I wanted to know if there is an accepted method for doing this.