Re: How to get the address of an proc with same name and different parameter type

2019-01-18 Thread slangmgh
I had tried this way, but failed. I can try again.

Re: How to get the address of an proc with same name and different parameter type

2019-01-18 Thread slangmgh
Yes, it can!! I had tried this way: cast[proc (x: string) {.nimcall.}](p2) Run It doesn't work.

Re: How to get the address of an proc with same name and different parameter type

2019-01-18 Thread Araq
Use a type conversion to disambiguate (I doubt that's documented well...) `(proc (x: string) {.nimcall.})(p2)`

Re: How to get the address of an proc with same name and different parameter type

2019-01-17 Thread dom96
Might be simpler to just rename your procedures :)

Re: How to get the address of an proc with same name and different parameter type

2019-01-16 Thread slangmgh
Find a way, the following code seems fine. proc p2(x: int) = echo x proc p2(x: string) = echo x let t1: proc(x: int) {.nimcall.} = p2 let t2: proc(x: string) {.nimcall.} = p2 t1(10) t2("string") echo toHex(cast[int](t1)) e

How to get the address of an proc with same name and different parameter type

2019-01-16 Thread slangmgh
When two proc have the same name, how can I get the proc address? proc p2(x: int) = echo x proc p2(x: string) = echo x let t1 = p2 # Run