I have an array
arrays which contains a number of arrays (arbitrary). How do I iterate through all combinations of elelements? If I know that there are e.g. 3 arrays I can do:
for e1 in arrays, e2 in arrays, e3 in arrays do_stuff([e1,e2,e3]) end
but if the number is arbitrary, what do I do then?