nim-wiki/Tips-and-tricks.textile

16 lines
456 B
Plaintext
Raw Normal View History

2013-01-24 17:03:20 +00:00
* Use "nimrod check myfile.nim" to check your program for errors, without code generation. This makes the process quicker.
2013-01-24 17:01:51 +00:00
h2. Using reserved words as identifiers
2013-01-24 17:03:20 +00:00
You can use the slanted quote string syntax if you need to use a reserved word as an identifier: <code>var `type`: int</code>
2010-09-14 10:11:11 +00:00
2013-01-24 17:01:51 +00:00
h2. Tricks with conditional compilation
2010-09-14 10:11:15 +00:00
2010-09-14 10:11:13 +00:00
<pre>
2010-09-14 10:11:11 +00:00
const someFeature = True
when someFeature:
const someSubFeature = true
else:
const someSubFeature = false
2010-09-14 10:11:13 +00:00
</pre>