NimContracts icon indicating copy to clipboard operation
NimContracts copied to clipboard

How to use it?

Open pmetras opened this issue 8 years ago • 5 comments

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

pmetras avatar Jan 22 '17 05:01 pmetras

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.

Udiknedormin avatar Sep 20 '17 18:09 Udiknedormin

It is now available via Nimble. Could you explain what exactly does README.md lack?

Udiknedormin avatar Sep 20 '17 21:09 Udiknedormin

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)

andreaferretti avatar Sep 25 '17 08:09 andreaferretti

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.

Udiknedormin avatar Oct 09 '17 09:10 Udiknedormin

Added both contracts explaining (enabled by explainContracts flag, described both in readme and docs) and some simple tests.

Udiknedormin avatar Nov 08 '17 07:11 Udiknedormin