Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Help with output form?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60986] Re: Help with output form?
  • From: ted.ersek at tqci.net
  • Date: Thu, 6 Oct 2005 04:08:27 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

A user wanted to make it so that evaluating
(lhs=rhs) would make the assignment and show
lhs=rhs in the output instead of just rhs.
The following more or less does this.


In[1]:=
  Unprotect[Set];
  $ModifySet=True;

  (lhs_=rhs_)/;$ModifySet:=
     Block[{$ModifySet}, lhs=rhs; HoldForm[lhs=rhs] ]

  Protect[Set];


In[5]:=
  y=Expand[(a+b)^2]

Out[5]=
  y = a^2 + 2 a b + b^2


But then you will have trouble if you use the above output cell to make a
new input expression.  That can be fixed if you use a package I have
posted at
  http://library.wolfram.com/infocenter/MathSource/705/

Then change HoldForm above to HoldTemporary.

----------
   Regards,
     Ted Ersek




  • Prev by Date: NET/Link return array from C++
  • Next by Date: Re: Problem with D and Abs
  • Previous by thread: Re: Re: Help with output form?
  • Next by thread: Re: Re: Help with output form?