Skip to content

callback functions see "old world" in 0.6 #19774

@stevengj

Description

@stevengj

It seems much harder to pass a proper closure as a callback function in Julia 0.6 than in previous versions due to #17057. In particular, the method described in the manual and in this blog post no longer works: passing the Function via a "thunk" void* that is called from a cfunction fails because the Function sees an "old world age".

See JuliaPy/PyCall.jl#343 and JuliaMath/Cubature.jl#22 and the mailing list, for example, but this will affect any package wrapping a C library that expects callback functions.

In PyCall, @yuyichao suggested using eval, but this is clunky and seems likely to impose a large performance penalty. Is there a better solution?

Metadata

Metadata

Labels

docsThis change adds or pertains to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions