nim-wiki/Tips-and-tricks.md

20 lines
534 B
Markdown

* Use "nimrod check myfile.nim" to check your program for errors, without code generation. This makes the process quicker.
## Using reserved words as identifiers
You can use the slanted quote string syntax if you need to use a reserved word as an identifier: ``var `type`: int``
## Tricks with conditional compilation
```nimrod
const someFeature = True
when someFeature:
const someSubFeature = true
else:
const someSubFeature = false
```
## How do I echo in a ``{.noSideEffects.}`` proc?
You can use ``debugEcho`` for this.