nim-wiki/Tips-and-tricks.textile

20 lines
542 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
2013-01-25 21:17:45 +00:00
```nimrod
2010-09-14 10:11:11 +00:00
const someFeature = True
when someFeature:
const someSubFeature = true
else:
const someSubFeature = false
2013-01-25 21:17:45 +00:00
```
2013-01-25 21:18:00 +00:00
h2. How do I echo in a {.noSideEffects.} proc?
2013-01-25 21:17:45 +00:00
You can use ``debugEcho`` for this.