DOCUMENTATION CENTER SEARCH
Mathematica
>
Namespace Management
>
Built-in
Mathematica
Symbol
Contexts
Contexts and Packages
Setting Up Mathematica Packages
Tutorials »
|
$Context
Contexts
Begin
$Packages
CellContext
See Also »
|
Mathematica Session Information
Namespace Management
Package Development
More About »
$ContextPath
$ContextPath
is a global variable that gives a list of contexts, after
$Context
, to search in trying to find a symbol that has been entered.
MORE INFORMATION
Each context is specified by a string of the form
"
name
`"
.
The elements of
$ContextPath
are tested in order to try to find a context containing a particular symbol.
$ContextPath
is modified by
BeginPackage
and
EndPackage
.
$ContextPath
is a rough analog for
Mathematica
symbols of the "search path" for files in many operating systems.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
The default contexts for looking up symbols:
In[1]:=
Out[1]=
If a symbol with a given name cannot be found in one of these contexts a new one is created:
In[2]:=
In[3]:=
Out[3]=
It is created in the context given by
$Context
:
In[4]:=
Out[4]=
Turn off the message for new symbol creation:
In[5]:=
Applications
(1)
SEE ALSO
$Context
Contexts
Begin
$Packages
CellContext
TUTORIALS
Contexts
Contexts and Packages
Setting Up
Mathematica
Packages
MORE ABOUT
Mathematica Session Information
Namespace Management
Package Development
New in 1
© 2008 Wolfram Research, Inc.