MathGroup Archive 2009

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

Search the Archive

Re: Re: listing user defined, independent variables

Hi Jens,

To your point a), what I mean is that, in the calculations that my notebook
carries out, some variables get defined by the user assigning a value (a
constant) directly to them. Others get defined in the code by assigning a
value to them that depends on a calculation involving other variables. As I
understand it, mathematica creates a store of all user defined symbols as a
list of replacement rules - so it "knows" which symbols are functions of
other symbols, and which are functions only of constants. What I was looking
for is a function that could work on each symbol's "replacement rules" in
such a way as to filter out those replacement rules which contain other

I have never heard of DownValue before, I shall explore your b) suggestion
with interest.

Thanks for you help. 


-----Original Message-----
From: Jens-Peer Kuska [mailto:kuska at] 
Sent: 25 February 2009 09:01
To: mathgroup at
Subject: [mg96832] [mg96782] Re: listing user defined, independent variables


a) what mean
    "Mathematica must 'know' which variables
     are functions of other symbols".
     Variables functions of other symbols ?? what should that be ??
b) Start a fresh kernel and type

blub[x_] := Module[{y, z}, x]


Names["Global`*"] gives

{"blub", "x", "x$", "y", "y$", "z", "z$"}

The "*$" symbols come from the Module[] and have th attribute Temporary
and the "blub" function has an DownValue[]. Since x,y,z appear in the 
down values of blub[] it is not possible to find out if there is also a
global symbol with a that has the name "x", "y" or "z".


Paul Ellsmore wrote:
> Hi,
> I have a notebook in which there are over 1300 variables (symbols)
> The vast majority of these are dependent variables. I can get a list of
> all with Names["Global`*"], but what I really want is a list of only the
> independent variables. Is there any obvious way to do this? Mathematica
> "know" which variables are functions of other symbols, so I was hoping
> there would be an "attribute" of a dependent variable that I could use as
> filter on Names[]. Any thoughts? I am using V5.1.
> Cheers,
> Paul
> Dr. Paul A. Ellsmore
> Nanion Limited
> Oxford Centre for Innovation
> Mill Street
> Oxford
> United Kingdom
> OX2 0JX
> Tel: +44 (0) 1865 811175
> Fax: +44 (0) 1865 248594

  • Prev by Date: Re: Counting Categories
  • Next by Date: Re: Manipulating list of functions
  • Previous by thread: Re: listing user defined, independent variables
  • Next by thread: newbie: can't Manipulate ListPlot of recurrence