End
End[]
返回当前上下文,并转换到前一个上下文.
更多信息
- End 的每一次调用必须提前使用 Begin 调用来平衡.
- End[] 重设 $Context 和 $ContextAliases 的值.
- End[] 以形式为 "context`" 的字符串来返回当前上下文的名称.
- End[] 不会修改 $ContextPath.
范例
打开所有单元 关闭所有单元属性和关系 (3)
Begin["cont`"] 将 $Context 设置为 "cont`":
End 将 $Context 恢复为匹配 Begin 之前的值:
不同于 BeginPackage,Begin 不修改 $ContextPath:
同样,End 也不进行修改:
Begin 不改变 $ContextAliases 的值:
End 将 $ContextAliases 恢复为其匹配 Begin 之前的值:
技术笔记
相关的工作流程
- 处理符号名称遮盖的问题
历史
1988年引入 (1.0) | 在以下年份被更新:2021 (13.0)
文本
Wolfram Research (1988),End,Wolfram 语言函数,https://reference.wolfram.com/language/ref/End.html (更新于 2021 年).
CMS
Wolfram 语言. 1988. "End." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2021. https://reference.wolfram.com/language/ref/End.html.
APA
Wolfram 语言. (1988). End. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/End.html 年
BibTeX
@misc{reference.wolfram_2025_end, author="Wolfram Research", title="{End}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/End.html}", note=[Accessed: 14-April-2026]}
BibLaTeX
@online{reference.wolfram_2025_end, organization={Wolfram Research}, title={End}, year={2021}, url={https://reference.wolfram.com/language/ref/End.html}, note=[Accessed: 14-April-2026]}