Update nep1 to show type keyword on its own line
This commit is contained in:
parent
518696f3a7
commit
19c436ab20
1 changed files with 16 additions and 12 deletions
12
doc/nep1.rst
12
doc/nep1.rst
|
|
@ -81,7 +81,8 @@ changed in the future.
|
||||||
|
|
||||||
var aVariable = "Meep"
|
var aVariable = "Meep"
|
||||||
|
|
||||||
type FooBar = object
|
type
|
||||||
|
FooBar = object
|
||||||
|
|
||||||
For constants coming from a C/C++ wrapper, ALL_UPPERCASE are allowed, but ugly.
|
For constants coming from a C/C++ wrapper, ALL_UPPERCASE are allowed, but ugly.
|
||||||
(Why shout CONSTANT? Constants do no harm, variables do!)
|
(Why shout CONSTANT? Constants do no harm, variables do!)
|
||||||
|
|
@ -99,12 +100,14 @@ changed in the future.
|
||||||
- Exception and Error types should have the "Error" suffix.
|
- Exception and Error types should have the "Error" suffix.
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
type UnluckyError = object of Exception
|
type
|
||||||
|
UnluckyError = object of Exception
|
||||||
- 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.
|
identifying prefix, such as an abbreviation of the enum's name.
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
type PathComponent = enum
|
type
|
||||||
|
PathComponent = enum
|
||||||
pcDir
|
pcDir
|
||||||
pcLinkToDir
|
pcLinkToDir
|
||||||
pcFile
|
pcFile
|
||||||
|
|
@ -113,7 +116,8 @@ changed in the future.
|
||||||
PascalCase.
|
PascalCase.
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
type PathComponent {.pure.} = enum
|
type
|
||||||
|
PathComponent {.pure.} = enum
|
||||||
Dir
|
Dir
|
||||||
LinkToDir
|
LinkToDir
|
||||||
File
|
File
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue