gpt4 book ai didi

compile-time - 如何在 Nim 编译时回显/打印?

转载 作者:行者123 更新时间:2023-12-04 12:12:11 25 4
gpt4 key购买 nike

在处理编译时特性时,最好使用 echo编译时的东西。如果 echo使用一个宏,它已经在编译时执行。但是也可以在编译时打印一些东西,例如从全局范围?我正在寻找类似 echoStatic 的函数在这个:

echoStatic "Compiling 1. set of macros..."

# some macro definitions

echoStatic "Compiling 2. set of macros..."

# more macro definitions

最佳答案

无需特殊echoStatic .这是通过running code at compile time的通用解决方案解决的,即使用 static堵塞:

static:
echo "Compiling 1. set of macros..."

# some macro definitions

static:
echo "Compiling 2. set of macros..."

# more macro definitions

关于compile-time - 如何在 Nim 编译时回显/打印?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42327194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com