summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-11-30 15:24:30 +0100
committerAraq <rumpf_a@web.de>2017-11-30 15:24:30 +0100
commit255902f9a5a9f92ce2d65996a43626eff4c3b52c (patch)
tree95f5ec714ccf2b235f1a12a04161dfefb7729915 /lib
parent34ac04f70509e9f9c3d28b1bb12e3d6e6ed3a947 (diff)
downloadNim-255902f9a5a9f92ce2d65996a43626eff4c3b52c.tar.gz
added macros.unpackVarargs
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index ebc9f7714..ee6c1a09f 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -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]