此为 Mathematica 4 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

EndPackage

Usage

EndPackage[ ]$Context$ContextPath 还原成先前的BeginPackage之前的值,并把当前上下文放到列表$ContextPath中.


Notes

EndPackage 的每一次调用必须提前使用BeginPackage调用来平衡.
EndPackage通常被用在一个Mathematica包的末尾.
EndPackage返回Null.
EndPackage 会重新设置$Context$ContextPath的值.
• 参见 Mathematica全书: 2.6.10节.
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.