Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在浏览 Nim 项目本身的代码时,我发现一些由“magic” pragma 修饰的 proc 缺少 proc 定义(示例)。没有文档来解释编译指示,我猜 proc 的定义在其他地方并且在编译时被合并。但我仍然无法通过搜索整个项目找到定义。
我是否误解了“魔术”编译指示?它的意义是什么?以及如何使用它?
{.magic.}pragma 用于定义内置操作和类型,即任何需要编译器魔法才能工作的东西(因此得名)。它不打算在系统模块之外使用。
{.magic.}