Migrated from tips-and-tricks v4

This commit is contained in:
Araq 2010-09-14 03:11:13 -07:00
parent 4367a5431c
commit 87ad6653d0
1 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,5 @@
h1. Coding guidelines
* Use the implicit "result" variable and try to avoid "return". * Use the implicit "result" variable and try to avoid "return".
* Do not use templates/macros when an inline proc suffices. * Do not use templates/macros when an inline proc suffices.
* Do not use "nil" for strings and sequences. The procs of the standard library which misuse "nil" as an error value will be deprecated. * Do not use "nil" for strings and sequences. The procs of the standard library which misuse "nil" as an error value will be deprecated.
@ -7,11 +9,13 @@ h1. 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> * You can use the slanted quote string syntax if you need to use a reserved word as an identifier: <code>var `type`: int</code>
h1. Tricks with conditional compilation h1. Tricks with conditional compilation
<pre><code> <pre>
<code>
const someFeature = True const someFeature = True
when someFeature: when someFeature:
const someSubFeature = true const someSubFeature = true
else: else:
const someSubFeature = false const someSubFeature = false
</code></pre> </code>
</pre>