@Udiknedormin Here you can use `static` types that passes data to macros 
instead of a `NimNode`
    
    
    import macros
    
    const module {.strdefine.}: string = "math"
    
    macro importconst(name: static[string]): untyped =
      #let value = name.symbol.getImpl
      #echo "variable name: ", name.repr
      #echo "default value: ", $value
      result = newNimNode(nnkImportStmt).add(newIdentNode(name))
    
    static:
      echo "actual  value: ", module
    importconst(module)
    

Reply via email to