Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Tuning & Debugging > Symbol Handling > $NewSymbol >
Mathematica > Core Language > Package Development > Namespace Management > Symbol Handling > $NewSymbol >

$NewSymbol

$NewSymbol
is a global variable which, if set, is applied to the name and context of each new symbol that Mathematica creates.
  • The name and context of the symbol are given as strings.
  • $NewSymbol is applied before the symbol is actually created. If the action of $NewSymbol causes the symbol to be created, perhaps in a different context, then the symbol as created will be the one used.
  • $NewSymbol is not applied to symbols automatically created by scoping constructs such as Module.
Set $NewSymbol to a function that prints the name and context when a new symbol is created:
Restore $NewSymbol to its default:
Set $NewSymbol to a function that prints the name and context when a new symbol is created:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
Restore $NewSymbol to its default:
In[4]:=
Click for copyable input
New in 2
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF