@@ -2677,10 +2677,8 @@ a parameter has different names between them.
26772677 proc foo(y: int) =
26782678 echo "Using y: ", y
26792679
2680- foo(x = 2)
2681- # Using x: 2
2682- foo(y = 2)
2683- # Using y: 2
2680+ foo(x = 2) # Using x: 2
2681+ foo(y = 2) # Using y: 2
26842682
26852683 Not supplying the parameter name in such cases results in an
26862684ambiguity error.
@@ -3160,7 +3158,7 @@ Return statement
31603158Example:
31613159
31623160.. code-block :: nim
3163- return 40+ 2
3161+ return 40 + 2
31643162
31653163 The `return ` statement ends the execution of the current procedure.
31663164It is only allowed in procedures. If there is an `expr `, this is syntactic
@@ -5859,7 +5857,7 @@ twice:
58595857While macros enable advanced compile-time code transformations, they
58605858cannot change Nim's syntax.
58615859
5862- **Style note **: For code readability, it is best to use the least powerful
5860+ **Style note: ** For code readability, it is best to use the least powerful
58635861programming construct that remains expressive. So the "check list" is:
58645862
58655863(1) Use an ordinary proc/iterator, if possible.
@@ -7108,12 +7106,12 @@ Noalias pragma
71087106Since version 1.4 of the Nim compiler, there is a `.noalias ` annotation for variables
71097107and parameters. It is mapped directly to C/C++'s `restrict `:c: keyword and means that
71107108the underlying pointer is pointing to a unique location in memory, no other aliases to
7111- this location exist. It is *unchecked * that this alias restriction is followed, if the
7109+ this location exist. It is *unchecked * that this alias restriction is followed. If the
71127110restriction is violated, the backend optimizer is free to miscompile the code.
71137111This is an **unsafe ** language feature.
71147112
71157113Ideally in later versions of the language, the restriction will be enforced at
7116- compile time. (Which is also why the name `noalias ` was choosen instead of a more
7114+ compile time. (This is also why the name `noalias ` was choosen instead of a more
71177115verbose name like `unsafeAssumeNoAlias `.)
71187116
71197117
@@ -7698,7 +7696,7 @@ Example:
76987696 {.pragma: rtl, importc, dynlib: "client.dll", cdecl.}
76997697
77007698 proc p*(a, b: int): int {.rtl.} =
7701- result = a+ b
7699+ result = a + b
77027700
77037701 In the example, a new pragma named `rtl ` is introduced that either imports
77047702a symbol from a dynamic library or exports the symbol for dynamic library
@@ -8105,8 +8103,8 @@ pragmas:
81058103 appropriate `locks `:idx: statement.
81068104
81078105
8108- Guards and the locks section
8109- ----------------------------
8106+ Guards and locks sections
8107+ -------------------------
81108108
81118109Protecting global variables
81128110~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -8179,8 +8177,8 @@ The `guard` annotation can also be used to protect fields within an object.
81798177The guard then needs to be another field within the same object or a
81808178global variable.
81818179
8182- Since objects can reside on the heap or on the stack this greatly enhances the
8183- expressivity of the language:
8180+ Since objects can reside on the heap or on the stack, this greatly enhances
8181+ the expressivity of the language:
81848182
81858183.. code-block :: nim
81868184
0 commit comments