in case anyone is left wondering... I've found a hackish way to brute force this, essentially summarized in https://github.com/one-more-minute/ObjectiveC.jl/issues/8
Maybe a macro guru can find a still better way, one that doesn't require re-parsing stringified variables :) On 24 November 2015 at 01:34, Dömötör Gulyás <[email protected]> wrote: > So apparently, this: https://github.com/JuliaLang/julia/issues/14110 is > not a bug. Which leaves me with the question, how to accomplish > concatenating the argument types tuple for ccall()? There doesn't seem to > be a way to accomplish the concatenation (without also evaluating the type > parameters) in ways that result in a valid argument type list for ccall(). > The idea is to not have to eval() at runtime for every ccall(), as > ObjectiveC.jl currently does. > > A simplified core part of the above: > > julia> U = (Ptr{UInt8},) > > (Ptr{UInt8},) > > > julia> :((Ptr{Void},Ptr{Void})..., $U...) > > :(((Ptr{Void},Ptr{Void})...,(Ptr{UInt8},)...)) > > > julia> Meta.show_sexpr(:((Ptr{Void},Ptr{Void})..., $U...)) > > (:tuple, (:..., (:tuple, (:curly, :Ptr, :Void), (:curly, :Ptr, :Void))), > (:..., (Ptr{UInt8},))) > > > The suggestion is not evaluate the macro, which still leaves the > unexpanded (Ptr{UInt8},) in there, and ccall() complains about the types. > With some mucking about of objc_msgSendTupleConcat sometimes that shows up > as (:curly, :Ptr, :UInt8) but only in ways that fail at the ccall or > julia trying to evaluate the tuple concatenation. > > Is there another way of doing this? I wasn't able to get the intended > behavior with a templated function, either, but it feels like it should be > possible. >
