mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
lenVarargs: number of varargs elements (#12907)
This commit is contained in:
committed by
Andreas Rumpf
parent
2e7c9eb6a8
commit
a0980c88c9
@@ -4198,6 +4198,11 @@ type
|
||||
NimNode* {.magic: "PNimrodNode".} = ref NimNodeObj
|
||||
## Represents a Nim AST node. Macros operate on this type.
|
||||
|
||||
macro lenVarargs*(x: varargs[untyped]): int {.since: (1, 1).} =
|
||||
## returns number of variadic arguments in `x`
|
||||
proc lenVarargsImpl(x: NimNode): NimNode {.magic: "LengthOpenArray", noSideEffect.}
|
||||
lenVarargsImpl(x)
|
||||
|
||||
when false:
|
||||
template eval*(blk: typed): typed =
|
||||
## Executes a block of code at compile time just as if it was a macro.
|
||||
|
||||
Reference in New Issue
Block a user