I don't have much experience with different lambda types in Nim and what is 
compatible and what is not compatible, but this works for me:
    
    
    import macros
    
    proc ptest(pid: int): bool {.procvar.} =
      echo "foo",$pid
      return if pid == 100: true else: false
    
    type
      ProcType = proc (pid:int):bool {.gcsafe, locks: 0.}
    
    var proc_list = newSeq[tuple[id:int; myproc: ProcType]]()
    var foo : ProcType = ptest
    
    proc_list.add((0,foo))
    proc_list.add((0,foo))
    proc_list.add((0,foo))
    
    echo proc_list[0][1](100), "\n"
    echo proc_list[1][1](200), "\n"
    echo proc_list[2][1](300)
    

I found it more randomly, I don't know what the problem is.

EDIT:

It might be that your type of `ptest` is just implicitly convertable to 
`ProcType`, but not of that type. When X is convertable to Y, it doesn't mean 
that `tuple[a: int, x: X]` is convertable to `tuple[a: int, x: Y]`. 

Reply via email to