Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10824 #12437

Merged
merged 2 commits into from
Oct 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,7 @@ for details on how to change this behavior.
Anonymous Procs
---------------

Unnamed procedures can be used as lambda expressions to pass into other
Unnamed procedures can be used as lambda expressions to pass into other
procedures:

.. code-block:: nim
Expand All @@ -3522,8 +3522,8 @@ procedures:


Procs as expressions can appear both as nested procs and inside top level
executable code. The `sugar <sugar.html>`_ module contains the `=>` macro
which enables a more succinct syntax for anonymous procedures resembling
executable code. The `sugar <sugar.html>`_ module contains the `=>` macro
which enables a more succinct syntax for anonymous procedures resembling
lambdas as they are in languages like JavaScript, C#, etc.


Expand Down Expand Up @@ -6224,6 +6224,25 @@ but are used to override the settings temporarily. Example:
# ... some code ...
{.pop.} # restore old settings

`push/pop`:idx: can switch on/off some standard library pragmas, example:

.. code-block:: nim
{.push inline.}
proc thisIsInlined(): int = 42
func willBeInlined(): float = 42.0
{.pop.}
proc notInlined(): int = 9

{.push discardable, boundChecks: off, compileTime, noSideEffect, experimental.}
template example(): string = "https://nim-lang.org"
{.pop.}

{.push deprecated, hint[LineTooLong]: off, used, stackTrace: off.}
proc sample(): bool = true
{.pop.}

For third party pragmas it depends on its implementation, but uses the same syntax.


register pragma
---------------
Expand Down