MathGroup Archive 2011

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

Search the Archive

How to evaluate parts of an expression, but not other parts?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122659] How to evaluate parts of an expression, but not other parts?
  • From: Julian Francis <julian.w.francis at gmail.com>
  • Date: Sat, 5 Nov 2011 04:45:28 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Dear all,

I'd like to use the TreePlot function to visualise the expression of a
dynamic programming problem I am working on.

If I have something like: ( (a+b) + (c+d )

Mathematica helpfully simplifies this to: a + b + c + d

But I'd prefer it to be in the original form.

I can't write Hold[ ( (a+b) + (c+d) )] because I do want a,b,c & d to
be evaluated.

I want to write something like:
Hold[ ( (Evaluate[a]+Evaluate[b]) + (Evaluate[c]+Evaluate[d]) ) ]

But this just leaves the Evaluate expressions unevaluated.

Any help greatly appreciated.

Thanks,
Julian.



  • Prev by Date: Part // interesting undocumented feature
  • Next by Date: Import files on accessible URL and save in local machine.
  • Previous by thread: Re: Part // interesting undocumented feature
  • Next by thread: Re: How to evaluate parts of an expression, but not other parts?