mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 16:31:39 +00:00
new pragma: 'noinit'
This commit is contained in:
@@ -1526,6 +1526,14 @@ T = enum cast[T](0); this may be an invalid value
|
||||
============================ ==============================================
|
||||
|
||||
|
||||
The implicit initialization can be avoided for optimization reasons with the
|
||||
`noinit`:idx: pragma:
|
||||
|
||||
.. code-block:: nimrod
|
||||
var
|
||||
a {.noInit.}: array [0..1023, char]
|
||||
|
||||
|
||||
Const section
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@@ -1781,6 +1789,7 @@ sugar for:
|
||||
result = expr
|
||||
return result
|
||||
|
||||
|
||||
``return`` without an expression is a short notation for ``return result`` if
|
||||
the proc has a return type. The `result`:idx: variable is always the return
|
||||
value of the procedure. It is automatically declared by the compiler. As all
|
||||
|
||||
Reference in New Issue
Block a user