diff options
author | awr1 <41453959+awr1@users.noreply.github.com> | 2019-10-10 02:28:54 -0500 |
---|---|---|
committer | Miran <narimiran@disroot.org> | 2019-10-10 09:28:54 +0200 |
commit | 3b1760df7265309f75c8cce4e9a34d928bea69e6 (patch) | |
tree | aa591fbb738662129a34c7ba8691b50650d9cd51 | |
parent | f728614ef8d47ad2ed92eb71dc39d5d0fc83671d (diff) | |
download | Nim-3b1760df7265309f75c8cce4e9a34d928bea69e6.tar.gz |
[backport] Mention "lambdas" and `=>` in the manual (#12397) [ci skip]
(so that "lambda" can be CTRL+F'd)
-rw-r--r-- | doc/manual.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/manual.rst b/doc/manual.rst index f7e1c939b..5f45970b1 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -3511,8 +3511,8 @@ for details on how to change this behavior. Anonymous Procs --------------- -Procs can also be treated as expressions, in which case it's allowed to omit -the proc's name. +Unnamed procedures can be used as lambda expressions to pass into other +procedures: .. code-block:: nim var cities = @["Frankfurt", "Tokyo", "New York", "Kyiv"] @@ -3522,7 +3522,9 @@ the proc's name. Procs as expressions can appear both as nested procs and inside top level -executable code. +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. Func |