MathGroup Archive 1997

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

Search the Archive

Plot has HoldAll, Why?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg5993] Plot has HoldAll, Why?
  • From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
  • Date: Sat, 8 Feb 1997 22:38:14 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Consider the following commands to plot two polynomials:

f=ChebyshevT[37,x];
g=ChebyshevT[38,x];
Plot[f, {x, -1,1}, DisplayFunction->Identity] //Timing
Plot[Evaluate[g], {x,-1,1}, DisplayFunction->Identity] //Timing

The second case works ten times faster.
I understand it's because Mma does't know Compiled functions can be
used unles Evaluate is called.

Plot has the Attribute "HoldAll".
I wouldn't need to use Evaluate if instead Plot had Attribute "HoldRest",
or if it didn't hold any arguments.

I know I can Unprotect Plot, and change the Attributes myself.
Does anyone know why it would be desireable to hold all arguuments of Plot?

     Puzzled in MD

     Ted Ersek



  • Prev by Date: PlotLabel??????
  • Next by Date: special ColorFunction
  • Previous by thread: PlotLabel??????
  • Next by thread: special ColorFunction