Working thru the incredible guide:
http://julialang.org/blog/2013/05/callback

I am stuck on understanding if there are any work arounds for being able to 
use julia anonymous functions in `ccall` callback functions. Specifically I 
am interested in the common case of wanting to use function parameters 
without having to do the C convention of passing around a void *param 
pointer as the last argument of the callback.
(ie instead of having func(x, y, param) I could do (x, y) -> func(x, y, a, 
b) to set the values for the parameters of a julia callback function that 
is passed to a ccall routine)

The above guide makes clear that this is currently not `cfunction` 
compile-able in a naive manner. But looking at the amazing packages like 
NLopt.jl and Cubature.jl the examples seem to show that using julia (x, y) 
-> func(x, y, a, b) like calls seem to be used as inputs. Is this the 
correct understanding? If I study the aforementioned blog post and the 
codes mentioned will I have the potential to write wrapper functions that 
can avoid having to mimic the void *param style in the julia code?

Thanks for any tips, or clarification.

Gabriel

Reply via email to