nqp_native_call()
needs return and parameter type info to set up the callback.- Likewise,
callback_handler()
needs the same to marshal the arguments and unpack the return value. - Given 1 and 2,
arg_types
in the NativeCall REPR needs to be a more expressive type thanINTVAL*
.struct { INTVAL; PMC * }*
perhaps? - 3 implies updating
nqp_native_call_build()
to build the correct structure. - Finally,
postcircumfix:<( )>
inrole Native
of NativeCall.pm6 needs to pass signature info for callback arguments tonqp_native_call_build()
.
Implementation should probably be backwards, starting with passing information about callbacks and working my way down to actually doing the dyncallback stuff.
Perl 6 callback parameter syntax for when I forget it: < jnthn> sub (int $n, &callback(Str, int, int --> int)) is native { * }