I have two matrices, A and B, that have the same number of columns.
I want to select the rows of A that differ in every position from
every row of B. So I write
Select[A, And@@Map[Inner[Unequal,#1,#2,And]&, B]& ]
But that won't work, because I have no way to tell Inner that one of
its arguments should be the row of A that is being tested by Select,
and the other argument should be the row of B from Map.
Now, I realize that there are ways around the problem in this
particular case. For instance, the Select test could be
And@@Map[FreeQ[Rest[#],First[#]]&, Transpose@Prepend[B,#]]&
which checks B a column at a time and might well be more efficient.
However, this is not the first time I've run into the problem of
specifying arguments inside nested functions, and I wonder how other
people handle it. Is there a general solution, or must I always
ad hoc it?