I keep producing bits of code like the following:
stuff = Module[
{curTarget = #},
getRowsForUserAndTarget[u, #, curTarget] & /@ validUsers
] & /@ allTargets;
Basically, I'm iterating through all the targets and all the users. Using a For loop it would look something like this (in python):
res = []
for user in validUsers:
for curTarget in allTargets:
res.append(getRowsForUserAndTarget[u, user, curTarget])
It seems like I should be able to do this succinctly in map notation using something like:
getRowsForUserAndTarget[#userthing, #targetthing]& /@ validUsers /@ validTargets
but I don't know how to keep the mapped arguments from interfering with each other, or how to reference which one I mean; and I'm a little hazy about the order of iteration (validUsers would go first, then validTargets?)
Can someone set me straight? This would seem like a common pattern that I am abusing with my Module[] solution...

Function[{user, target}, getRowsForUserAndTarget[user, target]]if you want to give your arguments names instead of#. – wxffles Apr 19 '12 at 20:30