MathGroup Archive 1998

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

Search the Archive

Re: Strange results

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14663] Re: Strange results
  • From: "David Bailey" <db at salford-software.com>
  • Date: Sat, 7 Nov 1998 02:10:17 -0500
  • Organization: Salford Software.com
  • References: <199810181910.PAA02298@smc.vnet.net.> <70k33r$ek9@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Garrett Tim Sos wrote in message <70k33r$ek9 at smc.vnet.net>...
>With several instructions are in a single cell, sometimes Mathematica
>assumes a multiply between one line and the next.  This can cause wired
>results or unexpected errors.  A ; at the end of a line always forces a
>break -- However, does not echo output. If this is undersireable, try
>surounding the line  with ( ).  This always fixes a problem with some
>typeset intergrals getting confused with the next line - and retained
>the output.
>
>I asked WR if there was a break that still produces output like a
>special form of ; - They said no.

If you execute the following code you will obtain a new operator
consisting of a semicolon subscripted with a capital 'P'. This will
have the desired effect of printing the result of its LHS and then
evaluating the RHS. (O.K. I know it is a bit ugly!).


MakeExpression[RowBox[{x_,SubscriptBox[";","P"],y_}],StandardForm]:=
      MakeExpression[

RowBox[{"CompoundExpression","[",RowBox[{"Print","[",x,"]"}],",",y,"]"}]];


David Bailey
Salford Software
db at salford-software.com




  • Prev by Date: How to transpose vector?
  • Next by Date: Re: Protecting from evaluation
  • Previous by thread: Re: How to transpose vector?
  • Next by thread: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)