nim-wiki/Tips-and-tricks.textile

16 lines
456 B
Plaintext

* Use "nimrod check myfile.nim" to check your program for errors, without code generation. This makes the process quicker.
h2. Using reserved words as identifiers
You can use the slanted quote string syntax if you need to use a reserved word as an identifier: <code>var `type`: int</code>
h2. Tricks with conditional compilation
<pre>
const someFeature = True
when someFeature:
const someSubFeature = true
else:
const someSubFeature = false
</pre>