MathGroup Archive 1999

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

Search the Archive

Re: getting the name of a symbol

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15477] Re: getting the name of a symbol
  • From: Stephen P Luttrell <luttrell at signal.dra.hmg.gb>
  • Date: Mon, 18 Jan 1999 04:22:18 -0500
  • Organization: Defence Evaluation and Research Agency
  • References: <77jjc1$2lf@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

>Within a function
>
>f[a_] := blah blah blah
>
>I want to make use of the name of the symbol supplied as input to the
>function.
>
>For example, if called as
>
>f[qxyz]
>
>I want to get the string "qxyz". I have looked at HoldForm and
>SymbolName but nothing yet discovered seems to do the trick.


ToString seems to do what you want.

For instance:

In[1]:=ToString[x]<>ToString[y]

Out[1]="xy"

Stephen P Luttrell
Signal Processing and Imagery Department DERA Malvern, St.Andrew's Road
Malvern, United Kingdom, WR14 3PS

+44 (0)1684 894046 (tel)
+44 (0)1684 894384 (fax)
luttrell at signal.dera.gov.uk (email)




  • Prev by Date: Re: Parts of a list
  • Next by Date: Re: listplot and notebook directory
  • Previous by thread: Re: getting the name of a symbol
  • Next by thread: statistical thermodynamics