I have a function with the following form:
function make_func() return x -> x*10 end
I would like to change it so that it will return a function that takes Cint and returns Cint, in order to pass it to C code as a callback using ccall. I expected this to work, but it doesn’t. (It gives a syntax error, unless I remove the type assertion on the parameter x.)
function make_func() f = function(x::Cint)::Cint return x*10 end return f end
Is there a way that I can specify both the input and return types of an anonymous function?