MathGroup Archive 1998

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

Search the Archive

Re: How to use HoldForm within Module


Chee:

In addition to your definition of doNOTCHANGE, if you add HoldFirst (or
HoldAll) to the Attributes of doNOTCHANGE, you should get what you
want.
 You set the attributes this way:

Attributes[doNOTCHANGE]={HoldFirst}


Ken Levasseur
Math. Sci. UMass Lowell


Chee Lim Cheung wrote:
> 
> Hello Mathematica gurus,
> 
> I am new to Mathematica. I need to use a function in its original form
> within Module.
> 
> e.g.,doNOTCHANGE[f_]:=Module[{g},g=HoldForm[f];Print[g]]
> 
> may not give what I want as f is already rearranged according to
> Mathematica's lexicographical order within Module,i.e.,HoldForm[f] in
> Module may not be exactly of the same form as f as defined. One example
> is f=-1(UnitStep[t-1]-UnitStep[t-2]).Can any of you out there show me
> the way to get f in its original form inside Module?
> 
> Thanks
> Chee


  • Prev by Date: Re: List handling
  • Previous by thread: How to use HoldForm within Module
  • Next by thread: RE: How to use HoldForm within Module