I wanted to draw some contours. I succeeded with this:
W1 = {p, -2, 2, 0.5};
W2 = {p, -10, 10, 1};
P = W1; ContourPlot[
Evaluate[Union[Table[y^2 == 2 p*x, Evaluate[P]],
Table[x^2 == 2 p*y, Evaluate[P]]]], {x, -5, 5}, {y, -5, 5}]
P = W2;
ContourPlot[Evaluate[
Union[Table[y^2 == 2 p*x, Evaluate[ P]],
Table[x^2 == 2 p*y, Evaluate[P]]]], {x, -5, 5}, {y, -5, 5}]
I don't like this solution. I used Evaluate[] a few times and I feel like it is unnecessary although without the function I get errors. Could anyone explain me that. I find the reference unhelpful (maybe that's my lack of language?) "causes expr to be evaluated even if it appears as the argument of a function whose attributes specify that it should be held unevaluated.".
ContourPlot[]
andTable[]
both have theHoldAll
attribute, so theEvaluate[]
is needed. $\endgroup$