change non-working example to runnableExamples (#15841)
This commit is contained in:
parent
dfa2f011d7
commit
cae92f670a
1 changed files with 5 additions and 7 deletions
|
|
@ -57,13 +57,11 @@ proc createProcType(p, b: NimNode): NimNode {.compileTime.} =
|
|||
|
||||
macro `=>`*(p, b: untyped): untyped =
|
||||
## Syntax sugar for anonymous procedures.
|
||||
##
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## proc passTwoAndTwo(f: (int, int) -> int): int =
|
||||
## f(2, 2)
|
||||
##
|
||||
## passTwoAndTwo((x, y) => x + y) # 4
|
||||
runnableExamples:
|
||||
proc passTwoAndTwo(f: (int, int) -> int): int =
|
||||
f(2, 2)
|
||||
|
||||
doAssert passTwoAndTwo((x, y) => x + y) == 4
|
||||
|
||||
var
|
||||
params = @[ident"auto"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue