documented implicit compileTime procs
This commit is contained in:
parent
64d9a5bc85
commit
48d8728e40
2 changed files with 17 additions and 1 deletions
|
|
@ -72,7 +72,20 @@ compileTime pragma
|
|||
------------------
|
||||
The ``compileTime`` pragma is used to mark a proc or variable to be used at
|
||||
compile time only. No code will be generated for it. Compile time procs are
|
||||
useful as helpers for macros.
|
||||
useful as helpers for macros. Since version 0.12.0 of the language, a proc
|
||||
that uses ``system.NimNode`` within its parameter types is implictly declared
|
||||
``compileTime``:
|
||||
|
||||
.. code-block:: nim
|
||||
proc astHelper(n: NimNode): NimNode =
|
||||
result = n
|
||||
|
||||
Is the same as:
|
||||
|
||||
.. code-block:: nim
|
||||
proc astHelper(n: NimNode): NimNode {.compileTime.} =
|
||||
result = n
|
||||
|
||||
|
||||
noReturn pragma
|
||||
---------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue