NimContracts
NimContracts copied to clipboard
How to use it?
Hello,
Can you include in the README.md file how to use this Nim extension? And list it in the Nimble repository for discoverability. It seems a nice extension to the already strong static typing of Nim.
Thanks
Sorry for late reply. I've just asked for publishing via Nimble. As for usage, I updated README.md for a little more informations. Examples, tests and better docs will come in the future.
It is now available via Nimble. Could you explain what exactly does README.md lack?
One thing that is not documented is how to turn assertions and invariants off (I assume there should be such a flag, not unlike normal assertions are eventually removed from production builds).
One more thing that would be useful is a flag to see the actual generated code at compile time (for instance, I have one in patty). One can be more confident about what is going to happen if there is a way to see what the macro actually generates (plus, it's super easy)
Oh, that's right. As for now, it's the same flag as for assertions. Even if it changes, you won't have to turn it off manually in release mode, it will always be done automagically.
I haven't thought about providing user with generated code as it's not the most beautiful code I've seen but surely, why not. I used it myself when testing.
Added both contracts explaining (enabled by explainContracts
flag, described both in readme and docs) and some simple tests.