MathGroup Archive 2001

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

Search the Archive

Re: displaying unevaluated arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31125] Re: displaying unevaluated arguments
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 12 Oct 2001 03:36:42 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9q2l05$p4b$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,


SetAttributes[f, HoldAll]

f[x_] := ToString[Unevaluated[x], InputForm]

and 

In[]:=y={1,2,3,4};
In[]:=f[{y^2, Sin[y], Log[y], Map[Cos[#] &, y]}]
Out[]= "{y^2, Sin[y], Log[y], (Cos[#1] & ) /@ y}"

Regards
  Jens

"Mark S. Coleman" wrote:
> 
> Greetings:
> 
> Is there a simple way to create the string form of an argument passed
> to a function/module? For instance, let
> 
> f[x_] := Module[ Some Mathematica Code... .];
> 
> Assume that y is defined as a list of numbers. If I evaluate
> 
>    f[{y^2,Sin[y],Log[y],Map[Cos[#]&,y]}],
> 
> I would like to get back   "{y^2,Sin[y],Log[y],Map[Cos[#]&,y]}" ,
> rather than the evaluated numerical values. When I create a function,
> HoldForm does not seem to work. The arguement is always evaluated
> first.
> 
> Thanks
> 
> -Mark


  • Prev by Date: Re: What variables are in a function and displaying surds
  • Next by Date: FindMinimum
  • Previous by thread: Re: displaying unevaluated arguments
  • Next by thread: What variables are in a function and displaying surds