lenVarargs: number of varargs elements (#12907)
This commit is contained in:
parent
2e7c9eb6a8
commit
a0980c88c9
2 changed files with 64 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue