Phil Clayton wrote:
Using the alloc form works when a parameter is both and input and an output: in the example C code below, the second parameter `pos` is an in-out. I notice that call_sym_and_convert doesn't have an InOut constructor for Union.directedArg. This appears to be a problem for ML types that are not a vol (i.e. not passed by reference in the C FFI) such as int. Is there a way around this?
I think I've answered the second question for myself: convert the value to a vol using a suitable toCxxx function and then just us the In constructor. (Therefore, in my previous example, the alloc could have been avoided for the in-out parameter.)