MathGroup Archive 1999

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

Search the Archive

Re: getting the name of a symbol

  • To: mathgroup at
  • Subject: [mg15437] Re: [mg15412] getting the name of a symbol
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Mon, 18 Jan 1999 04:21:42 -0500
  • Sender: owner-wri-mathgroup at

I am not quite sure if I have understood  perfecly what you would like
to do but I hope the following example will be helpful:

SetAttributes[myf, HoldFirst]
In[2]:= myf[x_Symbol] := HoldForm[x] == x^2

x = 2;
x == 4

If you want to get a string as your final output you can, of course,
define  myf[x_Symbol] := ToString[HoldForm[x] == x^2]

On Wed, Jan 13, 1999, Andrew Watson <abwatson at> wrote:

>Dear Matherati,
>I have a problem for which there must be a simple solution.
>Within a function
>f[a_] := blah blah blah
>I want to make use of the name of the symbol supplied as input to the
>For example, if called as
>I want to get the string "qxyz". I have looked at HoldForm and
>SymbolName but nothing yet discovered seems to do the trick.
>Andrew B. Watson
>MS 262-2
>NASA Ames Research Center
>Moffett Field, CA 94035-1000
>(650) 604-5419	(650) 604-0255 fax
>abwatson at

Andrzej Kozlowski
Toyama International University

  • Prev by Date: Symbolic Derivative of Piecewise Contin Fcn
  • Next by Date: Re: Re: Strange results
  • Previous by thread: getting the name of a symbol
  • Next by thread: Re: getting the name of a symbol