F#中有ifdef吗?

时间:2014-01-10 17:31:14

标签: f#

我想知道是否可以在调试模式下运行特定代码。

例如:

if DEBUG
 print "Hello World"

如果我处于调试模式,它只会打印“Hello World”,但是当我处于发布模式时,它应该被编译掉。这可能吗?

1 个答案:

答案 0 :(得分:8)

您可以将compiler directives用于此

#if DEBUG
printfn "Hello World"
#endif
相关问题