well, I'm found [similar theme](https://forum.nim-lang.org/t/3061/2). This 
works: 
    
    
    import macros
    
    macro load*(modulesSeq: varargs[untyped]): untyped =
      result = newStmtList()
      for module in modulesSeq:
        result.add parseStmt("from " & $module & " import nil")
    
    const a = 0
    
    when a == 0:
      load strutils
      echo strutils.join(@[1,2,3], ", ")
    elif a == 2:
      load asdsadasd # will excepted if set a to 2
    

cool

Reply via email to