Documentation only, Sugar arrow and semicolons (#18574)

* Document that sugar arrow do not support semicolon as argument separator
This commit is contained in:
Juan Carlos 2021-07-25 13:07:43 -03:00 • committed by GitHub
commit e08ec0c674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,8 @@ proc createProcType(p, b: NimNode): NimNode =
macro `=>`*(p, b: untyped): untyped = macro `=>`*(p, b: untyped): untyped =
## Syntax sugar for anonymous procedures. It also supports pragmas. ## Syntax sugar for anonymous procedures. It also supports pragmas.
##
## .. warning:: Semicolons can not be used to separate procedure arguments.
runnableExamples: runnableExamples:
proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2) proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2)
@ -133,6 +135,8 @@ macro `=>`*(p, b: untyped): untyped =
macro `->`*(p, b: untyped): untyped = macro `->`*(p, b: untyped): untyped =
## Syntax sugar for procedure types. It also supports pragmas. ## Syntax sugar for procedure types. It also supports pragmas.
##
## .. warning:: Semicolons can not be used to separate procedure arguments.
runnableExamples: runnableExamples:
proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2) proc passTwoAndTwo(f: (int, int) -> int): int = f(2, 2)
# is the same as: # is the same as: