|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
BeginPackage
BeginPackage["context`"]
makes
and
the only active contexts.
BeginPackage["context`", {"need1`", "need2`", ...}]
calls Needs on the
.
DetailsDetails
- BeginPackage is typically used at the beginning of a Mathematica package.
- BeginPackage resets the values of both $Context and $ContextPath.
- The interpretation of symbol names depends on context. BeginPackage thus affects the parsing of input expressions.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
Commands to define a simple package:
| In[1]:= |
The context for symbol creation has been changed to
:
| In[2]:= |
| Out[2]= |
The context path for symbol lookup includes
:
| In[3]:= |
| Out[3]= |
Here are the commands defining the function in the package:
| In[4]:= |
| In[5]:= |
Restore the context, but leave
on the context path for symbol lookup:
| In[6]:= |
Since EndPackage leaves
on the context path, the function defined is visible:
| In[8]:= |
| Out[8]= |
New in 1
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
