Markdown code blocks part 4 (#20189)
No logic was added, just 8 more files have been migrated.
This commit is contained in:
parent
8155837cde
commit
713f39083e
9 changed files with 365 additions and 341 deletions
|
|
@ -13,11 +13,12 @@ difficult is the ``newString`` proc: If it is simply wrapped, it
|
|||
should not be evaluated at compile time! On other occasions it can
|
||||
and should be evaluated:
|
||||
|
||||
.. code-block:: nim
|
||||
```nim
|
||||
proc toUpper(s: string): string =
|
||||
result = newString(len(s))
|
||||
for i in 0..len(s) - 1:
|
||||
result[i] = toUpper(s[i])
|
||||
```
|
||||
|
||||
No, it really can always be evaluated. The code generator should transform
|
||||
``s = "\0\0\0..."`` back into ``s = newString(...)``.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue