An easy workaround to not add `genericCall` \- passing `procs` as the first 
argument:
    
    
    # remote.nim, only changes
    
    # making exported
    var registeredProcs* {.compileTime.} = newSeq[string]()
    
    # ...
    
    proc genericCall*(procs: seq[string], id: string, x: float): float =
    # ...
    
    # user.nim
    import remote as remote_module
    
    proc userSquare(x: float): float {.remote.} = x * x
    proc userCubic(x: float): float {.remote.} = x * x * x
    
    const procs = registeredProcs
    
    discard procs.genericCall("userSquare", 1)
    discard procs.genericCall("userCubic", 1)
    

Maybe you can make `procs` in `genericCall` bound to the current module's 
symbol, then you can get rid of passing it as an argument.

Reply via email to