Python's Itertools has what is called starmap
. Given a collection of collections and a function, it applies the function to each collection strictly inside the collection, using the elements of said internal collection as arguments to the function. For example,
from itertools import starmap
NestedList = [(1, 2), (3, 4), (5, 6), (0, 0), (1, 1), (2, 2)]
list(starmap(lambda x, y:x + y, NestedList))
returns the list containing 3, 7, 11, 0, 2, and 4.
I refuse to believe that Python was the first to come up with this concept, but I'm drawing a blank when I try to think of what it was called in older languages. Does any analogous functionality exist in common lisp? I feel certain that it does, but I cannot name it.