mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
typos (#17824)
This commit is contained in:
@@ -86,7 +86,7 @@ type
|
||||
typeInst*: PackedItemId
|
||||
nonUniqueId*: int32
|
||||
|
||||
PackedNode* = object # 20 bytes
|
||||
PackedNode* = object # 28 bytes
|
||||
kind*: TNodeKind
|
||||
flags*: TNodeFlags
|
||||
operand*: int32 # for kind in {nkSym, nkSymDef}: SymId
|
||||
|
||||
@@ -277,7 +277,7 @@ inference. But it has to be enabled via `--sinkInference:on`, either
|
||||
on the command line or via a `push` pragma.
|
||||
|
||||
To enable it for a section of code, one can
|
||||
use `{.push sinkInference: on.}`...`{.pop.}`.
|
||||
use `{.push sinkInference: on.}` ... `{.pop.}`.
|
||||
|
||||
The `.nosinks`:idx: pragma can be used to disable this inference
|
||||
for a single routine:
|
||||
@@ -661,12 +661,12 @@ There is no copy during assigning operations.
|
||||
y[0] = 'h' # copy
|
||||
|
||||
The program above shows when the copy operations happen.
|
||||
When mutating the variable `y`, the Nim compiler creates a fresh copy of `x`,
|
||||
the variable `y` won't point to the string literal anymore.
|
||||
Instead it points to the copy of `x` of which the memory can be mutated
|
||||
When mutating the variable `y`, the Nim compiler creates a fresh copy of `x`,
|
||||
the variable `y` won't point to the string literal anymore.
|
||||
Instead it points to the copy of `x` of which the memory can be mutated
|
||||
and the variable `y` becomes a mutable string.
|
||||
|
||||
.. Note:: The abstraction fails for `addr x` because whether the address is going to be used for mutations is unknown.
|
||||
.. Note:: The abstraction fails for `addr x` because whether the address is going to be used for mutations is unknown.
|
||||
|
||||
Let's look at a silly example demonstrating this behaviour:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user