Created
April 8, 2017 14:13
-
-
Save cooldome/0f334cc0feaf5ac1c60082b73eec8a25 to your computer and use it in GitHub Desktop.
macro newSeq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro dseq(len : int) : typed = | |
let procTyped = newNimNode(nnkBracketExpr).add(bindSym("newSeq")).add(bindSym("int")) | |
result = newCall(procTyped, [len]) | |
let a = dseq(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does not compile with error:
Error: value of type 'seq[int]' has to be discarded