If you are just starting with Nim or teaching, I recommend to try first using 
`parseStmt`.
    
    
    macro name(argument: int): untyped = parseStmt "echo " & $(argument * 2)
    
    Run
    
    
    macro name(argument: float): untyped = parseStmt "echo " & $argument
    
    Run

Basically you make a string with the code and pass it to `parseStmt` and it 
does its magic.

You can also `echo` the string passed to `parseStmt` to see whats generating.

You can also call `template` inside `macro`. Theres `dumpAstGen` for debug. 

Reply via email to