diff options
author | Araq <rumpf_a@web.de> | 2017-11-30 15:24:30 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-11-30 15:24:30 +0100 |
commit | 255902f9a5a9f92ce2d65996a43626eff4c3b52c (patch) | |
tree | 95f5ec714ccf2b235f1a12a04161dfefb7729915 /lib | |
parent | 34ac04f70509e9f9c3d28b1bb12e3d6e6ed3a947 (diff) | |
download | Nim-255902f9a5a9f92ce2d65996a43626eff4c3b52c.tar.gz |
added macros.unpackVarargs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/macros.nim | 5 |
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] |