Mathematica 9 is now available

Begin

Usage

Begin["context`"] 重设当前上下文。


Notes

Begin["context`"] 重设当前上下文的值。 • 当前上符号名的解释与上下文有关。这样Begin影响输入表达式的分析。
• 参见 Mathematica 全书: 2.6.10.
• 参见: BeginPackage, End, $ContextPath.
Further Examples

This is the current context when you start Mathematica.

In[1]:=  

Out[1]=

This is the current context path. A symbol whose context name is not specified is looked up first in the current context, then in the contexts in $ContextPath.

In[2]:=  

Out[2]=

This command changes the current context, but not the context path.

In[3]:=  

Out[3]=

The following symbol does not exist either in the current context Temporary`, or in the contexts in $ContextPath. As a result, it is created in the current context.

In[4]:=  

Out[4]=

This is its full name.

In[5]:=  


Following this command, the earlier context is restored.

In[6]:=  

Out[6]=

Now newsymbol is not recognized, since the context it belongs to is not in the search path.

In[7]:=  

A very common use of Begin is to hide symbols defined in packages. This technique is illustrated in the Further Examples for BeginPackage.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.