MathGroup Archive 2000

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

Search the Archive

Re: With[{software=Mathematica}, Frustration]

  • To: mathgroup at
  • Subject: [mg24486] Re: [mg24308] With[{software=Mathematica}, Frustration]
  • From: AES <siegman at>
  • Date: Wed, 19 Jul 2000 01:21:58 -0400 (EDT)
  • Organization: Stanford University
  • References: <vfca5.325$> <8kje58$> <8l0ovj$>
  • Sender: owner-wri-mathgroup at

In article <8l0ovj$dpf at>, Mark Fisher 
<me.fisher at> wrote:

> I'm probably not paying enough attention, but what's wrong with the
> following?
> Print[
>   With[{a = 2., b = 3.}, 
>     Evaluate[StringForm["a = `1`, b = `2`, c = `3`, Sin[c] = `4`", 
> 	a, b, c, Sin[c]]]
>     ]
>   ]


The problem, to answer the question straightforwardly, is that an 
ordinary user [1] learns about Print[ ] and uses it lots of places in 
his notebooks; and then he learns about With[ ] and uses it a few 
places; and they work, and both seem like reasonably simple, intuitive, 
useful commands.

So then he, very reasonably, tries to put the two together by using 
Print[] inside With[] -- and it doesn't work.

So, he starts groping around, and after some searching gets introduced 
to Evaluate[]; and Evaluate[], though it's a somewhat messy and 
mysterious command, does work -- sometimes, that is -- within With[].  

But, it doesn't work with Print[] inside With[] to accomplish the rather 
elementary objective outline above  [2].

So, after a lot of time-wasting trial and error, a person obviously 
pretty expert in Mathematica is finally able to accomplish the objective 
by using StringForm[], which is a really obscure and esoteric command, 
seldom needed by the ordinary user [3]

Don't get me wrong:  I'm a Mathematica fan; regard it (along with TeX) 
as a true work of genius; understand its need to have some real 
complexity to accomplish all the things it does; and appreciate that 
many design decisions had to be made in creating it.

But it's primary target, or one of its primary targets, is supposed to 
be the "ordinary user" [1]; and for the ordinary user who tries to move 
even slightly beyond the elementary things that he knows how to use, or 
who tries to make two apparently elementary things work together (like 
Wiht[] and Print[]) Mathematica can become *maddeningly* frustrating.


[1]  An ordinary user is someone who just wants to get useful 
calculations done using Mathematica in his or her own area of expertise, 
not spend his life becoming an expert in the arcane esoterica that you 
can get involved in with Mathematica, if you're unlucky or not careful.

[2]  Challenge: Accomplish the above task using *only* Print[], With[] 
and Evaluate[] -- no other Mathematica functions.

[3]  Note that StringForm[] is not discussed at all in The Beginners 
Guide to Mathematica by Glynn and Gray, and isn't treated except for a 
passing mention on page 715 of Mathematica for Scientists and Engineers 
by Thomas Bahder.

  • Prev by Date: Re: FixedPoint vs. FixedPointList
  • Next by Date: JLink: InstallJava[] problem with Slackware Linux 2.2.14 and JDK 1.2.2
  • Previous by thread: Re: Re: With[{software=Mathematica}, Frustration]
  • Next by thread: printing 2D graphics with a known scale