mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 02:42:05 +00:00
change non-working example to runnableExamples (#15841)
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user