Yeah that was pretty dumb- I guess I was a little overworked there, sorry.

The original non-simplified version didn't work for unrelated reasons: It 
appears that a missing in a struct full of function pointers seemed to throw 
off the memory addresses, causing some random address to be called, that by 
coincidence contained something that didn't do anything.
    
    
    
    # bad
    type
      foo* {.bycopy.} = object
        bar*: proc ()
        fuz*: proc ()    # calling fooObject.fuz() points to the wrong address, 
either crashing or calling something else
    
    # good
    type
      foo* {.bycopy.} = object
        bar*: proc () {.cdecl.}
        fuz*: proc () {.cdecl.}   # this works
    
    
    

Then I simplified the thing and behaved the same, so...

For posterity, part of what I was missing was how to print function pointer 
addresses:
    
    
    # echo function pointer from struct passed from C++
    echo "fooObject.fuz: ", cast[cint](fooObject.fuz)
    

Reply via email to