I need to build functionalities based on Table function.
In[42]:= Table[{u, v}, {u, {1, 2, 3}}, {v, {4, 5}}]
Out[42]= {{{1, 4}, {1, 5}}, {{2, 4}, {2, 5}}, {{3, 4}, {3, 5}}}
So I put it in a function :
f[x_, y_] := Table[{u,v}, {u, x}, {v, y}]
f perfectly works for the previous example:
In[2]:= f[{1, 2, 3}, {4, 5}]
Out[2]= {{{1, 4}, {1, 5}}, {{2, 4}, {2, 5}}, {{3, 4}, {3, 5}}}
but it doesnt work in that case :
In[3]:= f[{a, b, c}, {u, v}]
Out[3]= {{{a, a}, {a, v}}, {{b, b}, {b, v}}, {{c, c}, {c, v}}}
As an evidence, local variable is the point. If I create a function, the first property I expect is encapsulation. I don't need interference with caller symbol space, especially for iterators.
So what is the correct way to make iterators "isolated", no interfering with the parameters content ?
Regards