Re: How to get string representation of int inside of the macros?

2018-04-02 Thread Arrrrrrrrr
repr works better than $ in macros.

Re: How to get string representation of int inside of the macros?

2018-04-02 Thread r3d9u11
cool, thanks for another solution!

Re: How to get string representation of int inside of the macros?

2018-04-02 Thread jangko
or you can use intVal, strVal, etc on literal nodes import macros macro initNui(a:int): typed = result = parseStmt("const b=" & $a.intVal) initNui(1)

Re: How to get string representation of int inside of the macros?

2018-03-30 Thread r3d9u11
many thanks, it works! (I'll try to search and read about static types)

Re: How to get string representation of int inside of the macros?

2018-03-30 Thread mashingan
add static to the type import macros macro initNui(a: static[int]): typed = result = parseStmt("const b = " & $a) initNui 1

How to get string representation of int inside of the macros?

2018-03-30 Thread r3d9u11
Hello. I tried to represent int to string inside a macros: import macros macro initNui(a:int): typed = result = parseStmt("const b=" & $a) initNui(1) but I had compilcation error: unhandled exception: false Invalid node kind nnkIntLit for