I am trying to learn about macros and get the incredibly vague error 
    
    
     Error: request to generate code for .compileTime proc: newProc
    
    Run

when trying to compile:
    
    
    discard newProc(name=newIdentNode("test"),
                    params=[
                      newIdentNode("int"),
                      nnkIdentDefs.newTree(
                        newIdentNode("x"),
                        newIdentNode("int")
                        )
                      ],
                    body=nnkStmtList.newTree(
                          nnkInfix.newTree(
                            newIdentNode("+"),
                            newIdentNode("x"),
                            newLit(2)
                            )
                          )
                        )
    
    
    Run

attempting to generate this proc:
    
    
    proc test(x: int): int =
      x + 2
    
    
    Run

Any ideas?

Reply via email to