MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Evaluate[] not needed in With[]

  • To: mathgroup at
  • Subject: [mg62974] Re: Evaluate[] not needed in With[]
  • From: "Jens-Peer Kuska" <kuska at>
  • Date: Fri, 9 Dec 2005 06:39:56 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <dnbnav$5ti$>
  • Sender: owner-wri-mathgroup at


With[] does a (clever) ReplaceAll[] of the constants
you give, in its body before the body is evaluated.
This means that the argument of ParametricPlot[] in your
example is replaced by the value of hlines ..
and so you don't need a Evaluate[].


"Steven T. Hatton" <hattons at> 
schrieb im Newsbeitrag 
news:dnbnav$5ti$1 at
|I started looking at Dr. Maeder's _Programming in 
Mathematica_, and was
| doing quite well understanding everything until 
I got to the first example
| in the first section of the first chapter.  He 
gives an example of using
| ParametricPlot and tells us "Because 
ParametricPlot evaluates its arguments
| in a nonstandard way, we need to force 
evaluation of the variable hline by
| wrapping in into Evaluate[]."  He later tells me 
I don't need to do that
| for a "constant" in a With[] expression.  The 
following is a cobbled
| together example showing both forms:
| Clear[z, x, y, cz, hlines, vlines];
| z = x + y I;
| cz = {Re[z], Im[z]};
| hg = With[{hlines = Table[N[cz], {y, -1, 1, 
|      ParametricPlot[hlines, {x, -Pi/2, Pi/2},
|          DisplayFunction -> Identity][[1]]
|      ];
| vlines = Table[N[cz], {x, -Pi/2, Pi/2, Pi/12}];
| vg = ParametricPlot[Evaluate[vlines], {y, -1, 
|        DisplayFunction -> Identity][[1]];
| Show[Graphics[Join[hg, vg], AspectRatio -> 
Automatic, Axes -> True]]
| I can read the words, and follow the 
instructions, but I still don't
| understand _why_ the version in the With[] 
expression doesn't need the
| Evaluate[].  Is there a way to _explain_ this 
behavior, or do I simply need
| to memorize the rule by rote?
| -- 
| The Mathematica Wiki:
| Math for Comp Sci
| Math for the WWW:

  • Prev by Date: Fwd: Getting good results with NDSolve?
  • Next by Date: Re: Types in Mathematica thread
  • Previous by thread: Re: Evaluate[] not needed in With[]
  • Next by thread: Re: Evaluate[] not needed in With[]