EndPackage
Usage
• EndPackage[ ]把$Context和 $ContextPath 还原成先前的BeginPackage之前的值,并把当前上下文放到列表$ContextPath中.
Notes
• EndPackage 的每一次调用必须提前使用BeginPackage调用来平衡. • EndPackage通常被用在一个Mathematica包的末尾. • EndPackage返回Null. • EndPackage 会重新设置$Context和$ContextPath的值.
Further Examples
Nested BeginPackages and EndPackages behave properly. Here we have two nested context changes.
In[1]:=
|
Out[1]=
|
The first EndPackage restores the context that was current before the last BeginPackage.
In[2]:=
|
Out[2]=
|
Another EndPackage restores the original context.
In[3]:=
|
Out[3]=
|
同时参见 the Further Examples for BeginPackage.
|