Possible Duplicate:
Using pure functions in Table
I have run into a situation that I do not understand when trying to generate a nested list of pure functions. I have the following code.
Table[Function[x, i*x + j], {i, 1, 3}, {j, 1, 4}]
I expected to get a nested list of pure functions, but the values for i
and j
are not being input. I get
{{Function[x, i x + j], Function[x, i x + j], Function[x, i x + j],
Function[x, i x + j]}, {Function[x, i x + j], Function[x, i x + j],
Function[x, i x + j], Function[x, i x + j]}, {Function[x, i x + j],
Function[x, i x + j], Function[x, i x + j], Function[x, i x + j]}}
What is making this operation fail to behave as I expected?