While m_goldberg is entirely correct that there are more idiomatic approaches within Mathematica I would like to answer the question that was asked. Yes, you can get that kind of iteration. You need to be familiar with the different scoping constructs in Mathematica to understand one of the choices that you face. Do and Table operate by the mechanism of Block in that they temporarily change the value of their iterators. So for example:
foo := bar
Do[Print[foo], {bar, 1, 3}] (* outputs 1, 2, 3 *)
In many cases, such as your example, you do not need that behavior; it is sufficient to replace literal appearances of the iterator variables in the body of the loop. This is akin to With or ReplaceAll. If so we can use destructuring to assign values to the variables:
Do[
iter /. {j_, k_, l_} :> Print[j, " ", k, " ", l],
{iter, {{a, b, z}, {c, d, y}}}
]
If you do need the full Block-like scoping then you need something more. I will use Block to prevent external modification of the working variables. Using a different form of destructuring the assignment {j, k, l} = iter is made as the first operation in the body of the loop, separated by CompoundExpression.
foo := Sequence[j, " ", k, " ", l];
Block[{j, k, l},
Do[
{j, k, l} = iter; Print[foo],
{iter, {{a, b, z}, {c, d, y}}}
]
]
f[#1, x2, #2, #3] &[a, b, z] ;
Do[Print[f[#1, #2, #3, x4] &[i[[1]], i[[2]], i[[3]]]], {i, {{a, b, z}, {c, d, y}}}];. I have used [i[[1]], i[[2]], i[[3]]]]. Please tell me whether there is any equivalent easy way of writing this. thanks – user22180 May 13 '14 at 22:28