Sorry, I don't understand your reply.

Assume we have the low level proc
    
    
    proc gtk_widget_get_preferred_height*(self: ptr Widget00; minimumHeight: 
var int32; naturalHeight: var int32) {.
        importc: "gtk_widget_get_preferred_height", libprag.}
    

with two var parameters -- well int32 here, but it may be any other non 
standard Nim type like uint or float.

And people may want Nim's int type.

What I already have for my higher level wrapper is somethink like a proc like
    
    
    proc getPreferredHeight*(self: Widget; minimumHeight: var int32; 
naturalHeight: var int32)
    

Here self is a Nim proxy object, which contains the low level GTK widget, 
enabling garbage collection and all that. But still we have to wrap the int32 
types, because the (non existent) users may want to pass plain ints. The 
question was, should I do it like pointed out in my initial post, or if there 
is a better solution. I think converters do not help for this case, and indeed 
my wrapper does contain no converters at all until now, and I want to keep that 
state, converters increase compile time, Araq does not like them too much. It 
may still be possible to do the conversion with a Nim macro, maybe by 
manipulating the AST. But is there a real advantage? I don't think so. So I 
think I will do it like indicated in the initial posing. 

Reply via email to