You can use something like this: 
    
    
    import macros
    
    var procs {.compileTime.}: seq[NimNode]
    
    macro script(p: typed): typed =
      procs.add p
    
    proc someProc() {.script.} =
      discard
    
    static:
      echo procs.repr
    
    
    Run

However, this requires global compile time state, which will likely not be 
supported this way when incremental compilation is finished. See 
[https://github.com/nim-lang/Nim/issues/7874](https://github.com/nim-lang/Nim/issues/7874)

Reply via email to