added macros.unpackVarargs

This commit is contained in:
Araq
2017-11-30 15:24:30 +01:00
parent 34ac04f705
commit 255902f9a5
2 changed files with 6 additions and 0 deletions

View File

@@ -117,3 +117,4 @@ This now needs to be written as:
your code work with both old and new Nim versions.
See [special-operators](https://nim-lang.org/docs/manual.html#special-operators)
for more information.
- Added ``macros.unpackVarargs``.

View File

@@ -1226,3 +1226,8 @@ when not defined(booting):
macro payload: untyped {.gensym.} =
result = parseStmt(e)
payload()
macro unpackVarargs*(callee: untyped; args: varargs[untyped]): untyped =
result = newCall(callee)
for i in 0 ..< args.len:
result.add args[i]