给出所编译函数的信息.
CurrentCompiledFunctionData[prop]
给出所编译函数的属性 prop 的值.
CurrentCompiledFunctionData
给出所编译函数的信息.
CurrentCompiledFunctionData[prop]
给出所编译函数的属性 prop 的值.
更多信息
- CurrentCompiledFunctionData 仅在编译代码中可用.
- 通过调用 CurrentCompiledFunctionData 返回的名称将是 FunctionDeclaration 所设置的名称.
- CurrentCompiledFunctionData["ReturnType"] 是访问函数返回类型的一种有用方法.
- 调用 CurrentCompiledFunctionData 会返回类型为 "CompiledFunctionData" 的结果.
- 调用 CurrentCompiledFunctionData 的结果包含了所编译函数的类型信息,因此无法从函数中返回该结果.
- 支持以下属性:
-
"Type" 所编译函数的类型 "ReturnType" 所编译函数返回结果的类型
范例
打开所有单元 关闭所有单元基本范例 (2)
如果 CurrentCompiledFunctionData 出现在具有名称的函数中,则包括在内:
范围 (3)
CurrentCompiledFunctionData 只能在编译代码中使用:
CurrentCompiledFunctionData 的结果可以传递到一个可以提取名称等信息的函数中:
这将打印出现 CurrentCompiledFunctionData 的函数的名称:
可能存在的问题 (1)
调用 CurrentCompiledFunctionData 的结果无法从函数中返回:
若将 CurrentCompiledFunctionData[] 转换为 "InertExpression",则编译可能成功:
当被调用时,生成的 CompiledFunctionData 对象显示返回类型为 "InertExpression":
技术笔记
相关指南
-
▪
- 代码编译
文本
Wolfram Research (2025),CurrentCompiledFunctionData,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html.
CMS
Wolfram 语言. 2025. "CurrentCompiledFunctionData." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html.
APA
Wolfram 语言. (2025). CurrentCompiledFunctionData. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html 年
BibTeX
@misc{reference.wolfram_2025_currentcompiledfunctiondata, author="Wolfram Research", title="{CurrentCompiledFunctionData}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html}", note=[Accessed: 10-April-2026]}
BibLaTeX
@online{reference.wolfram_2025_currentcompiledfunctiondata, organization={Wolfram Research}, title={CurrentCompiledFunctionData}, year={2025}, url={https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html}, note=[Accessed: 10-April-2026]}