Updated NEP 1 : Style Guide for Nimrod Code (markdown)
This commit is contained in:
parent
d2e4a708a1
commit
57cc6fcb5e
|
@ -64,7 +64,6 @@ be changed in the future.
|
||||||
|
|
||||||
type FooBar = object
|
type FooBar = object
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- When naming types that come in value, pointer, and reference varieties,
|
- When naming types that come in value, pointer, and reference varieties,
|
||||||
use a regular name for the variety that is to be used the most, and add
|
use a regular name for the variety that is to be used the most, and add
|
||||||
|
@ -75,13 +74,11 @@ be changed in the future.
|
||||||
handle = int64 # Will be used most often
|
handle = int64 # Will be used most often
|
||||||
handleRef = ref handle # Will be used less often
|
handleRef = ref handle # Will be used less often
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- Exception and Error types should have the "Error" suffix.
|
- Exception and Error types should have the "Error" suffix.
|
||||||
```nimrod
|
```nimrod
|
||||||
type unluckyError = object of E_Base
|
type unluckyError = object of E_Base
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- Unless marked with the `{.pure.}` pragma, members of enums should have an
|
- Unless marked with the `{.pure.}` pragma, members of enums should have an
|
||||||
identifying prefix, such as an abbreviation of the enum's name. Since
|
identifying prefix, such as an abbreviation of the enum's name. Since
|
||||||
|
@ -121,7 +118,6 @@ be changed in the future.
|
||||||
wordyTupleMemberTwo: int
|
wordyTupleMemberTwo: int
|
||||||
wordyTupleMemberThree: double
|
wordyTupleMemberThree: double
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- Similarly, any procedure type declarations that are longer than one line
|
- Similarly, any procedure type declarations that are longer than one line
|
||||||
should be formatted in the style of a regular type.
|
should be formatted in the style of a regular type.
|
||||||
|
@ -133,7 +129,6 @@ be changed in the future.
|
||||||
event: Event
|
event: Event
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- Multi-line procedure declarations/argument lists should continue on the same
|
- Multi-line procedure declarations/argument lists should continue on the same
|
||||||
column as the opening brace. This style is different from that of procedure
|
column as the opening brace. This style is different from that of procedure
|
||||||
|
@ -145,7 +140,6 @@ be changed in the future.
|
||||||
proc lotsOfArguments(argOne: string, argTwo: int, argThree:float
|
proc lotsOfArguments(argOne: string, argTwo: int, argThree:float
|
||||||
argFour: proc(), argFive:bool): int
|
argFour: proc(), argFive:bool): int
|
||||||
```
|
```
|
||||||
<br>
|
|
||||||
|
|
||||||
- Multi-line procedure calls should either have one argument per line
|
- Multi-line procedure calls should either have one argument per line
|
||||||
(like multi-line type declarations) or continue on the same
|
(like multi-line type declarations) or continue on the same
|
||||||
|
|
Loading…
Reference in New Issue