With 0.3, the tuple gets turned into an anonymous struct because it only
contains bitstypes.

I recommend matching the C API exactly in your Julia declaration to avoid
surprises, not just whichever is working


On Sunday, May 11, 2014, Jay Weisskopf <[email protected]> wrote:

> Suppose we have a C library that takes a callback with inputs (Cint,
> Cfloat). The conventional way of creating a callback would be:
>
> function foo(x::Cint, y::Cfloat)
> # do something with x and y
> return nothing
> end
> cfunction(foo, Void, (Cint, Cfloat))
>
> The following alternative way also appears to work in v0.3 (but not v0.2,
> which blows up when accessing args). I'd like to know if this is a
> deliberate change and safe, or simply a coincidence that could be unsafe.
>
> function bar(args::(Cint, Cfloat))
> x, y = args
> # do something with x and y
> return nothing
> end
> cfunction(bar, Void, ((Cint, Cfloat),))
>
> Thanks,
> Jay
>

Reply via email to