mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
Documentation only, Sugar arrow and semicolons (#18574)
* Document that sugar arrow do not support semicolon as argument separator
This commit is contained in:
@@ -54,6 +54,8 @@ proc createProcType(p, b: NimNode): NimNode =
|
||||
|
||||
macro `=>`*(p, b: untyped): untyped =
|
||||
## Syntax sugar for anonymous procedures. It also supports pragmas.
|
||||
##
|
||||
## .. warning:: Semicolons can not be used to separate procedure arguments.
|
||||
runnableExamples:
|
||||
proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2)
|
||||
|
||||
@@ -133,6 +135,8 @@ macro `=>`*(p, b: untyped): untyped =
|
||||
|
||||
macro `->`*(p, b: untyped): untyped =
|
||||
## Syntax sugar for procedure types. It also supports pragmas.
|
||||
##
|
||||
## .. warning:: Semicolons can not be used to separate procedure arguments.
|
||||
runnableExamples:
|
||||
proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2)
|
||||
# is the same as:
|
||||
|
||||
Reference in New Issue
Block a user