I am trying to create a function that can take any function pointer and "wrap" it so that it takes data from a lua VM and feeds it to the function, and then pushes the return values to the VM. I have a few questions:
- Is there any way I can make the comptime type field only accept function pointers (but accept any function pointer)?
- How can I print out/use the type info of the function? The compiler says
values of type '[]const builtin.Type.Fn.Param' must be comptime-known, but index value is runtime-known. - How much of this, if any, can I do at comptime?
- How much static code can the comptime function generate, or is that too macro-like?