Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Retrieve definitions (aka ?)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16129] Re: [mg16095] Retrieve definitions (aka ?)
  • From: Clemens Frey <clemens.frey at bitoek.uni-bayreuth.de>
  • Date: Sat, 27 Feb 1999 03:23:02 -0500
  • References: <Pine.SOL.4.05.9902251744370.3896-100000@btr0x1.rz.uni-bayreuth.de>
  • Sender: owner-wri-mathgroup at wolfram.com

Mitch Stonehocker wrote
> 
> Hi,
> In the context of a larger process (in a Module[] for example) I want to
> see what the global/local definition of a variable.  

<snip>

Hi Mitch,
for getting the right-hand sides of rules of the tmp=... type the
OwnValues-function can be used. So I would try something like the
following; notice that globaltmp=tmp relates to the global tmp:

tmp = 1;

f[x_] := Module[ {tmp,globaltmp=tmp},
  tmp = x;
  {OwnValues[globaltmp],OwnValues[tmp]}
]

Then this 
#[[1,2]]& /@ f[a+b]

will return
{1,a+b}

I don't know if the global definition of tmp can be retrieved in a more
straightforward way... Let's wait and see.

Hope that helps
Clemens


  • Prev by Date: Re: Reset In[ ] & Out[ ]
  • Next by Date: Re: help with pde
  • Previous by thread: Using Utilities`Notation` in a package