added macros.unpackVarargs
This commit is contained in:
parent
34ac04f705
commit
255902f9a5
2 changed files with 6 additions and 0 deletions
|
|
@ -117,3 +117,4 @@ This now needs to be written as:
|
||||||
your code work with both old and new Nim versions.
|
your code work with both old and new Nim versions.
|
||||||
See [special-operators](https://nim-lang.org/docs/manual.html#special-operators)
|
See [special-operators](https://nim-lang.org/docs/manual.html#special-operators)
|
||||||
for more information.
|
for more information.
|
||||||
|
- Added ``macros.unpackVarargs``.
|
||||||
|
|
|
||||||
|
|
@ -1226,3 +1226,8 @@ when not defined(booting):
|
||||||
macro payload: untyped {.gensym.} =
|
macro payload: untyped {.gensym.} =
|
||||||
result = parseStmt(e)
|
result = parseStmt(e)
|
||||||
payload()
|
payload()
|
||||||
|
|
||||||
|
macro unpackVarargs*(callee: untyped; args: varargs[untyped]): untyped =
|
||||||
|
result = newCall(callee)
|
||||||
|
for i in 0 ..< args.len:
|
||||||
|
result.add args[i]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue