-
Notifications
You must be signed in to change notification settings - Fork 5
Clarification on generating contracts in release mode. #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It may be that Nim's default behavior changed since back when this library was written, as it was before 1.0. You're correct to assume the intention is still to not generate any runtime checks for Thank you for your offer of help too, it is very welcome. |
I also found the part of Nim docs about that: From Nim 0.20:
Same for 1.0.0, 1.2.0 and 1.4.0 --- the change has only been introduced in Nim 1.6.0:
That being said, I looked through the NimContracts documentation and I haven't found any explicit mention of From
Which, indeed, uses the term "release code", but it is described which flag to use right above (which still holds true):
However, from the FAQ:
Because the default Nim behavior changed, I'd rather change it back and update the docs of |
…_release no checks for release mode; even for Nim 1.6.0 (Issue #18)
Ah, thank you very much, for the clarification and your work. I agree with the solution. I think, the issue can be closed. Have a nice time. 😄 |
Documentation says that NimContracts doesn't generate any code for runtime when build with release mode. But the code says something different. 😄 The contracts are not generated only when assertions are disabled during compilation. They are enabled by default for
-d:release
mode, at least for Nim 1.6.6. Thus, my question is, who is right? The documentation or the code? 😉Personally, I would prefer to go in the documentation way, enable generation of contracts only when a code is compiled in
debug
mode. If this version preferred, I can create PR with proper changes, it should be a small patch.The text was updated successfully, but these errors were encountered: