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.

Reply via email to