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 =
|
macro `=>`*(p, b: untyped): untyped =
|
||||||
## Syntax sugar for anonymous procedures.
|
## Syntax sugar for anonymous procedures.
|
||||||
##
|
runnableExamples:
|
||||||
## .. code-block:: nim
|
proc passTwoAndTwo(f: (int, int) -> int): int =
|
||||||
##
|
f(2, 2)
|
||||||
## proc passTwoAndTwo(f: (int, int) -> int): int =
|
|
||||||
## f(2, 2)
|
doAssert passTwoAndTwo((x, y) => x + y) == 4
|
||||||
##
|
|
||||||
## passTwoAndTwo((x, y) => x + y) # 4
|
|
||||||
|
|
||||||
var
|
var
|
||||||
params = @[ident"auto"]
|
params = @[ident"auto"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue