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

MathGroup Archive 1997

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

Search the Archive

Re: names, symbols, and contexts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6193] Re: [mg6175] names, symbols, and contexts
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Thu, 27 Feb 1997 02:53:28 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

murray at math.umass.edu (Murray Eisenberg)
[mg6175] names, symbols, and contexts


> Here's the problem:  a symbol fname contains the name of a
> Mathematica object, e.g.:
>
>   fname = "myf"
>
> The question is how to determine the context of the object named
> byfname (in our case, the context of myf).

Murray,
The following may help:

ff = "hh";
hh = Tan;
	
Context@@ToExpression[ff,InputForm, Hold] (*context of hh*)
	
	Global`

Context[Evaluate[ToExpression[ff]] (*context of value of hh*)
	
	System`
	
	
Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk


  • Prev by Date: Re: HelpBrowserSettingsSize "out of range"?
  • Next by Date: Re: Information about non-symbol heads
  • Previous by thread: names, symbols, and contexts
  • Next by thread: Re: names, symbols, and contexts