MathGroup Archive 2005

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

Search the Archive

Re: Help with output form?

  • To: mathgroup at
  • Subject: [mg60929] Re: [mg60902] Help with output form?
  • From: "David Park" <djmp at>
  • Date: Tue, 4 Oct 2005 01:24:56 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Something like the following?

Print["Our starting expression"]
y == (a + b)^2
Print["Expanding the right hand side"]
MapAt[Expand, %%, 2]

David Park
djmp at 

From: aufgang [mailto:aufgang at]
To: mathgroup at

I am struggling to get mathematica to output certain expressions the
way I'd like and i'm wondering if anyone could help me.

normally, when you input an expression using the Set operator (=),
mathematica evaluates the expression, assigns the rhs to the lhs and
returns the evaluated rhs  (eg.  y=Expand[(a+b)^2] -> a^2+2 a b +b^2)

what I would like to do is coax mathematica to output the lhs as wel as
the evaluated rhs (ie.  y=Expand[(a+b)^2] -> y=a^2+2 a b +b^2).

I want the rhs to be evaluated like normal, and the value of the lhs to
be set to rhs, so so Hold, HoldForm, etc wont work (they keep the lhs
but wont evaluate the rhs and the value isnt actually set) and I know I
dont want to be using == instead of =.  i just want the lhs to appear
in the output.

the reson I want to do this is because I am calling the Mathematica
Kernel from a web app and I want to display this output format to the

I suspect I could do this somehow by redefining Set or something but i
can't seem to figure that out.  

Thanks for any help.

  • Prev by Date: Re: BinCounts
  • Next by Date: Re: ImplicitPlot in 3D of several equations
  • Previous by thread: Re: Re: Help with output form?
  • Next by thread: Re: Re: Help with output form?