MathGroup Archive 2007

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

Search the Archive

Re: Re: Hold and Equal

  • To: mathgroup at
  • Subject: [mg73863] Re: Re: Hold and Equal
  • From: albert <awnl at>
  • Date: Fri, 2 Mar 2007 06:32:36 -0500 (EST)
  • References: <erufqm$s7j$> <> <> <es6bt0$r9q$>


>    Attributes@formEquation=List@HoldFirst
>    formEquation[expr_,op_]:=With[{result=op@expr},HoldForm[expr=result]]
>    Table[formEquation[Integrate[x^n, x], Identity], {n, 1, 2}]//InputForm
> {HoldForm[Integrate[x^n, x] = x^2/2], HoldForm[Integrate[x^n, x] = x^3/3]}
> I used InputForm there so could copy as plain text from Mathematica to
> here.  The problem is that both entries in the list have x^n on the left
> side of the equations now.

I think now you are asking for quite much: You want the expression to be
evaluated partially, that is n should be evaluated but not Integrate. I
think the only way to achieve this is to tell mathematica which parts you
want to be evaluated, the following should work:




Of course one could argue that Table should be implemented in such a way,
that n will always be inserted in the "evaluted" form since the unevaluated
n doesn't look very usefull. This would be possible, and as an exercise to
learn the details about evaluation you might want to write a myTable that
behaves like that, but probably there were good reasons why Table behaves
as it does.

Using different constructs than Table, you could achieve the same results
without having even more trouble with evaluation, e.g.:




  • Prev by Date: Re: Beginner--Problem with FilledPlot
  • Next by Date: Re: Regression
  • Previous by thread: Re: Hold and Equal
  • Next by thread: Re: Re: Re: Hold and Equal