import macros
type
Tconfig = tuple
letters: seq[string]
numbers:seq[int]
const data: Tconfig = (@["aa", "bb"], @[11, 22])
macro mymacro(data: Tconfig): stmt =
echo "AST being passed in:\n", treeRepr(data)
echo "root type is ", data.kind
echo "number of children ", len(data)
let n1 = data[0]
mymacro(data)
# ... and the compiler reports an error:
#AST being passed in:
#Ident !"data"
#root type is nnkIdent
#number of children 0
#stack trace: (most recent call last)
#mactest.nim(14) mymacro
#mactest.nim(16, 7) Info: instantiation from here
#mactest.nim(14, 15) Error: index out of bounds
Following the stackoverflow example, we would expect a nice AST report and not an error. The root type should be nnkPar.
What did I wrong? Wrong compiler version? (I used 0.10.2)
"Indeed, works with the current Nim devel branch."
How to get it easily for win64? Is there a zip file which can be used for koch.exe?
@fadg44a3w4fe : The entry on stackoverflow was made at Dec '13 and seemed to work fine. I can't imagine that this is a problem of ver. 0.10.2 - it must be something else .
How to get it easily for win64?
The only way I know of, is to follow the build instructions on https://github.com/araq/nim#compiling