On Wednesday, May 27, 2015 at 8:44:08 AM UTC-4, Andreas Lobinger wrote:
>
> Hello colleagues,
>
> i'm doing some adaptation of a GUI thing (mostly for learning purposes) 
> and try to get a full picture about callbacks or closures. The latest 
> docs.julia on Calling C etc. is referencing a blog article of may2013 (and 
> talking about v0.2). 
>
> Is there something newer? I understand that ccall has changed in v0.4, but 
> has cfunction also?
>

Things still pretty much work the same way.

The main change is the addition of the Ref types, which can optionally be 
used with cfunction to make some things a bit cleaner for passing args by 
reference (e.g. see the updated qsort example 
in http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/).

Another slight improvement is that you can use T(x) on the return value, 
rather than convert(T, x)::T, since the default definition of T(x) for a 
type T already performs the typeassert.

Reply via email to