Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

With[{software=Mathematica}, Frustration]

  • To: mathgroup at
  • Subject: [mg24308] With[{software=Mathematica}, Frustration]
  • From: AES <siegman at>
  • Date: Fri, 7 Jul 2000 00:11:52 -0400 (EDT)
  • Organization: Stanford University
  • Sender: owner-wri-mathgroup at

Pages 359-360 of The Mathematica Book says (admittedly, taken a little 
out of context), 

   "You can think of  With  as a generalization of the /. operator. . ."


   " With[{x=x0}, body]  works essentially like body /. x->x0 . . . "

Great, looks neat, let's try it for evaluating expressions without 
permanently setting the variables in them:

   In[1]:= c = a b

   Out[1]= a b

   In[2]:= c

   Out[2]= a b

   In[10]:= c /. {a -> 2, b -> 3}

   Out[10]= 6

   In[3]:= With[{a = 2, b = 3}, c]

   Out[3]= a b

*Not* what I was hoping for  . . .

  • Prev by Date: Do loop var in deferred assignment
  • Next by Date: Re: Plotting multiple functions using Map
  • Previous by thread: RE: Do loop var in deferred assignment
  • Next by thread: Re: With[{software=Mathematica}, Frustration]